mirror of https://github.com/tc39/test262.git
Use verifyProperty in language/global-code tests
This commit is contained in:
parent
8ff30c73ce
commit
e6f1feb04d
|
@ -41,8 +41,10 @@ includes: [propertyHelper.js]
|
|||
assert.sameValue(
|
||||
typeof brandNew, 'function', 'new binding on an extensible global object'
|
||||
);
|
||||
verifyEnumerable(this, 'brandNew');
|
||||
verifyWritable(this, 'brandNew');
|
||||
verifyNotConfigurable(this, 'brandNew');
|
||||
verifyProperty(this, 'brandNew', {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
});
|
||||
|
||||
function brandNew() {}
|
||||
|
|
|
@ -32,11 +32,11 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
this.brandNew, undefined, 'new binding on an extensible global object'
|
||||
);
|
||||
verifyEnumerable(this, 'brandNew');
|
||||
verifyWritable(this, 'brandNew');
|
||||
verifyNotConfigurable(this, 'brandNew');
|
||||
verifyProperty(this, "brandNew", {
|
||||
value: undefined,
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
});
|
||||
|
||||
var brandNew;
|
||||
|
|
|
@ -43,9 +43,11 @@ $262.evalScript('function brandNew() {}');
|
|||
assert.sameValue(
|
||||
typeof brandNew, 'function', 'new binding on an extensible global object'
|
||||
);
|
||||
verifyEnumerable(this, 'brandNew');
|
||||
verifyWritable(this, 'brandNew');
|
||||
verifyNotConfigurable(this, 'brandNew');
|
||||
verifyProperty(this, 'brandNew', {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'configurable', { configurable: true, value: 0 });
|
||||
Object.defineProperty(
|
||||
|
@ -63,9 +65,11 @@ $262.evalScript('function configurable() {}');
|
|||
assert.sameValue(
|
||||
typeof configurable, 'function', 'like-named configurable property'
|
||||
);
|
||||
verifyEnumerable(this, 'configurable')
|
||||
verifyWritable(this, 'configurable');
|
||||
verifyNotConfigurable(this, 'configurable');
|
||||
verifyProperty(this, 'configurable', {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
});
|
||||
|
||||
$262.evalScript('function nonConfigurable() {}');
|
||||
|
||||
|
@ -74,6 +78,8 @@ assert.sameValue(
|
|||
'function',
|
||||
'like-named non-configurable data property that is writable and enumerable'
|
||||
);
|
||||
verifyEnumerable(this, 'nonConfigurable');
|
||||
verifyWritable(this, 'nonConfigurable');
|
||||
verifyNotConfigurable(this, 'nonConfigurable');
|
||||
verifyProperty(this, 'nonConfigurable', {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
});
|
||||
|
|
|
@ -34,12 +34,12 @@ includes: [propertyHelper.js]
|
|||
|
||||
$262.evalScript('var brandNew;');
|
||||
|
||||
assert.sameValue(
|
||||
this.brandNew, undefined, 'new binding on an extensible global object'
|
||||
);
|
||||
verifyEnumerable(this, 'brandNew');
|
||||
verifyWritable(this, 'brandNew');
|
||||
verifyNotConfigurable(this, 'brandNew');
|
||||
verifyProperty(this, 'brandNew', {
|
||||
value: undefined,
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
});
|
||||
|
||||
Object.defineProperty(
|
||||
this,
|
||||
|
@ -58,14 +58,18 @@ Object.preventExtensions(this);
|
|||
|
||||
$262.evalScript('var configurable;');
|
||||
|
||||
assert.sameValue(configurable, 0, 'like-named configurable property');
|
||||
verifyNotEnumerable(this, 'configurable');
|
||||
verifyNotWritable(this, 'configurable');
|
||||
verifyConfigurable(this, 'configurable');
|
||||
verifyProperty(this, 'configurable', {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
$262.evalScript('var nonConfigurable;');
|
||||
|
||||
assert.sameValue(nonConfigurable, 0, 'like-named non-configurable property');
|
||||
verifyNotEnumerable(this, 'nonConfigurable');
|
||||
verifyNotWritable(this, 'nonConfigurable');
|
||||
verifyNotConfigurable(this, 'nonConfigurable');
|
||||
verifyProperty(this, 'nonConfigurable', {
|
||||
value: 0,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: false,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue