mirror of https://github.com/tc39/test262.git
Assert extensibility of dataview objects
This commit is contained in:
parent
97a54fc7a0
commit
93635ca3b2
|
@ -1,4 +0,0 @@
|
|||
//@ runDefault
|
||||
// This test passes if it does not crash.
|
||||
let x = new DataView(new ArrayBuffer(1));
|
||||
Object.defineProperty(x, 'foo', {});
|
|
@ -28,9 +28,27 @@ info: |
|
|||
5. Set the [[Extensible]] internal slot of obj to true.
|
||||
...
|
||||
features: [SharedArrayBuffer]
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var buffer = new SharedArrayBuffer(8);
|
||||
var sample = new DataView(buffer, 0);
|
||||
|
||||
assert(Object.isExtensible(sample));
|
||||
|
||||
Object.defineProperty(sample, 'baz', {});
|
||||
assert(sample.hasOwnProperty('baz'), 'confirms extensibility adding a new property');
|
||||
|
||||
Object.defineProperty(sample, 'foo', {
|
||||
value: 'bar',
|
||||
writable: true,
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
|
||||
verifyProperty(sample, 'foo', {
|
||||
value: 'bar',
|
||||
writable: true,
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
|
|
|
@ -26,9 +26,27 @@ info: |
|
|||
...
|
||||
5. Set the [[Extensible]] internal slot of obj to true.
|
||||
...
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var buffer = new ArrayBuffer(8);
|
||||
var sample = new DataView(buffer, 0);
|
||||
|
||||
assert(Object.isExtensible(sample));
|
||||
|
||||
Object.defineProperty(sample, 'baz', {});
|
||||
assert(sample.hasOwnProperty('baz'), 'confirms extensibility adding a new property');
|
||||
|
||||
Object.defineProperty(sample, 'foo', {
|
||||
value: 'bar',
|
||||
writable: true,
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
|
||||
verifyProperty(sample, 'foo', {
|
||||
value: 'bar',
|
||||
writable: true,
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue