mirror of https://github.com/tc39/test262.git
Update built-ins/Object to use verifyProperty
This commit is contained in:
parent
e108e876cd
commit
03a0375267
|
@ -7,6 +7,8 @@ includes: [propertyHelper.js]
|
|||
es6id: 19.1.2.1
|
||||
---*/
|
||||
|
||||
verifyWritable(Object, "assign");
|
||||
verifyNotEnumerable(Object, "assign");
|
||||
verifyConfigurable(Object, "assign");
|
||||
verifyProperty(Object, "assign", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -15,10 +15,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.assign.length, 2, "The length property of the assign method should be 2."
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Object.assign, 'length');
|
||||
verifyNotWritable(Object.assign, 'length');
|
||||
verifyConfigurable(Object.assign, 'length');
|
||||
verifyProperty(Object.assign, "length", {
|
||||
value: 2,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,12 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.assign.name,
|
||||
'assign',
|
||||
'The value of `Object.assign.name` is `"assign"`'
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Object.assign, 'name');
|
||||
verifyNotWritable(Object.assign, 'name');
|
||||
verifyConfigurable(Object.assign, 'name');
|
||||
verifyProperty(Object.assign, "name", {
|
||||
value: "assign",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,8 +8,9 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.entries.length, 1, 'Expected Object.entries.length to be 1');
|
||||
|
||||
verifyNotEnumerable(Object.entries, 'length');
|
||||
verifyNotWritable(Object.entries, 'length');
|
||||
verifyConfigurable(Object.entries, 'length');
|
||||
verifyProperty(Object.entries, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,12 +8,9 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.entries.name,
|
||||
'entries',
|
||||
'Expected Object.entries.name to be "entries"'
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Object.entries, 'name');
|
||||
verifyNotWritable(Object.entries, 'name');
|
||||
verifyConfigurable(Object.entries, 'name');
|
||||
verifyProperty(Object.entries, "name", {
|
||||
value: "entries",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,6 +8,8 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(Object, 'entries');
|
||||
verifyWritable(Object, 'entries');
|
||||
verifyConfigurable(Object, 'entries');
|
||||
verifyProperty(Object, "entries", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.getOwnPropertyDescriptor.name, "getOwnPropertyDescriptor");
|
||||
|
||||
verifyNotEnumerable(Object.getOwnPropertyDescriptor, "name");
|
||||
verifyNotWritable(Object.getOwnPropertyDescriptor, "name");
|
||||
verifyConfigurable(Object.getOwnPropertyDescriptor, "name");
|
||||
verifyProperty(Object.getOwnPropertyDescriptor, "name", {
|
||||
value: "getOwnPropertyDescriptor",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,8 +8,9 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.getOwnPropertyDescriptors.length, 1, 'Expected Object.getOwnPropertyDescriptors.length to be 1');
|
||||
|
||||
verifyNotEnumerable(Object.getOwnPropertyDescriptors, 'length');
|
||||
verifyNotWritable(Object.getOwnPropertyDescriptors, 'length');
|
||||
verifyConfigurable(Object.getOwnPropertyDescriptors, 'length');
|
||||
verifyProperty(Object.getOwnPropertyDescriptors, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,12 +8,9 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.getOwnPropertyDescriptors.name,
|
||||
'getOwnPropertyDescriptors',
|
||||
'Expected Object.getOwnPropertyDescriptors.name to be "getOwnPropertyDescriptors"'
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Object.getOwnPropertyDescriptors, 'name');
|
||||
verifyNotWritable(Object.getOwnPropertyDescriptors, 'name');
|
||||
verifyConfigurable(Object.getOwnPropertyDescriptors, 'name');
|
||||
verifyProperty(Object.getOwnPropertyDescriptors, "name", {
|
||||
value: "getOwnPropertyDescriptors",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,6 +8,8 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(Object, 'getOwnPropertyDescriptors');
|
||||
verifyWritable(Object, 'getOwnPropertyDescriptors');
|
||||
verifyConfigurable(Object, 'getOwnPropertyDescriptors');
|
||||
verifyProperty(Object, "getOwnPropertyDescriptors", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.getOwnPropertyNames.name, "getOwnPropertyNames");
|
||||
|
||||
verifyNotEnumerable(Object.getOwnPropertyNames, "name");
|
||||
verifyNotWritable(Object.getOwnPropertyNames, "name");
|
||||
verifyConfigurable(Object.getOwnPropertyNames, "name");
|
||||
verifyProperty(Object.getOwnPropertyNames, "name", {
|
||||
value: "getOwnPropertyNames",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -22,8 +22,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.getOwnPropertySymbols.length, 1);
|
||||
|
||||
verifyNotEnumerable(Object.getOwnPropertySymbols, "length");
|
||||
verifyNotWritable(Object.getOwnPropertySymbols, "length");
|
||||
verifyConfigurable(Object.getOwnPropertySymbols, "length");
|
||||
verifyProperty(Object.getOwnPropertySymbols, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.getOwnPropertySymbols.name, "getOwnPropertySymbols");
|
||||
|
||||
verifyNotEnumerable(Object.getOwnPropertySymbols, "name");
|
||||
verifyNotWritable(Object.getOwnPropertySymbols, "name");
|
||||
verifyConfigurable(Object.getOwnPropertySymbols, "name");
|
||||
verifyProperty(Object.getOwnPropertySymbols, "name", {
|
||||
value: "getOwnPropertySymbols",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.getPrototypeOf.name, "getPrototypeOf");
|
||||
|
||||
verifyNotEnumerable(Object.getPrototypeOf, "name");
|
||||
verifyNotWritable(Object.getPrototypeOf, "name");
|
||||
verifyConfigurable(Object.getPrototypeOf, "name");
|
||||
verifyProperty(Object.getPrototypeOf, "name", {
|
||||
value: "getPrototypeOf",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -9,6 +9,8 @@ author: Jamie Kyle
|
|||
features: [Object.hasOwn]
|
||||
---*/
|
||||
|
||||
verifyWritable(Object, "hasOwn");
|
||||
verifyNotEnumerable(Object, "hasOwn");
|
||||
verifyConfigurable(Object, "hasOwn");
|
||||
verifyProperty(Object, "hasOwn", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -21,8 +21,9 @@ author: Jamie Kyle
|
|||
features: [Object.hasOwn]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.hasOwn.name, "hasOwn");
|
||||
|
||||
verifyNotEnumerable(Object.hasOwn, "name");
|
||||
verifyNotWritable(Object.hasOwn, "name");
|
||||
verifyConfigurable(Object.hasOwn, "name");
|
||||
verifyProperty(Object.hasOwn, "name", {
|
||||
value: "hasOwn",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -10,8 +10,9 @@ description: >
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.is.length, 2, "The value of `Object.is.length` is `2`");
|
||||
|
||||
verifyNotEnumerable(Object.is, "length");
|
||||
verifyNotWritable(Object.is, "length");
|
||||
verifyConfigurable(Object.is, "length");
|
||||
verifyProperty(Object.is, "length", {
|
||||
value: 2,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -10,8 +10,9 @@ description: >
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.is.name, 'is', "The value of `Object.is.name` is `'is'`");
|
||||
|
||||
verifyNotEnumerable(Object.is, "name");
|
||||
verifyNotWritable(Object.is, "name");
|
||||
verifyConfigurable(Object.is, "name");
|
||||
verifyProperty(Object.is, "name", {
|
||||
value: "is",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -10,10 +10,10 @@ description: >
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
|
||||
assert.sameValue(typeof Object.is, "function");
|
||||
assert.sameValue(Object.is.name, "is");
|
||||
|
||||
verifyWritable(Object, "is");
|
||||
verifyNotEnumerable(Object, "is");
|
||||
verifyConfigurable(Object, "is");
|
||||
verifyProperty(Object, "is", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.isExtensible.name, "isExtensible");
|
||||
|
||||
verifyNotEnumerable(Object.isExtensible, "name");
|
||||
verifyNotWritable(Object.isExtensible, "name");
|
||||
verifyConfigurable(Object.isExtensible, "name");
|
||||
verifyProperty(Object.isExtensible, "name", {
|
||||
value: "isExtensible",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.isFrozen.name, "isFrozen");
|
||||
|
||||
verifyNotEnumerable(Object.isFrozen, "name");
|
||||
verifyNotWritable(Object.isFrozen, "name");
|
||||
verifyConfigurable(Object.isFrozen, "name");
|
||||
verifyProperty(Object.isFrozen, "name", {
|
||||
value: "isFrozen",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.isSealed.name, "isSealed");
|
||||
|
||||
verifyNotEnumerable(Object.isSealed, "name");
|
||||
verifyNotWritable(Object.isSealed, "name");
|
||||
verifyConfigurable(Object.isSealed, "name");
|
||||
verifyProperty(Object.isSealed, "name", {
|
||||
value: "isSealed",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.keys.name, "keys");
|
||||
|
||||
verifyNotEnumerable(Object.keys, "name");
|
||||
verifyNotWritable(Object.keys, "name");
|
||||
verifyConfigurable(Object.keys, "name");
|
||||
verifyProperty(Object.keys, "name", {
|
||||
value: "keys",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.preventExtensions.name, "preventExtensions");
|
||||
|
||||
verifyNotEnumerable(Object.preventExtensions, "name");
|
||||
verifyNotWritable(Object.preventExtensions, "name");
|
||||
verifyConfigurable(Object.preventExtensions, "name");
|
||||
verifyProperty(Object.preventExtensions, "name", {
|
||||
value: "preventExtensions",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -11,6 +11,8 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(this, "Object");
|
||||
verifyWritable(this, "Object");
|
||||
verifyConfigurable(this, "Object");
|
||||
verifyProperty(this, "Object", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.prototype.hasOwnProperty.name, "hasOwnProperty");
|
||||
|
||||
verifyNotEnumerable(Object.prototype.hasOwnProperty, "name");
|
||||
verifyNotWritable(Object.prototype.hasOwnProperty, "name");
|
||||
verifyConfigurable(Object.prototype.hasOwnProperty, "name");
|
||||
verifyProperty(Object.prototype.hasOwnProperty, "name", {
|
||||
value: "hasOwnProperty",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.prototype.propertyIsEnumerable.name, "propertyIsEnumerable");
|
||||
|
||||
verifyNotEnumerable(Object.prototype.propertyIsEnumerable, "name");
|
||||
verifyNotWritable(Object.prototype.propertyIsEnumerable, "name");
|
||||
verifyConfigurable(Object.prototype.propertyIsEnumerable, "name");
|
||||
verifyProperty(Object.prototype.propertyIsEnumerable, "name", {
|
||||
value: "propertyIsEnumerable",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.prototype.toLocaleString.name, "toLocaleString");
|
||||
|
||||
verifyNotEnumerable(Object.prototype.toLocaleString, "name");
|
||||
verifyNotWritable(Object.prototype.toLocaleString, "name");
|
||||
verifyConfigurable(Object.prototype.toLocaleString, "name");
|
||||
verifyProperty(Object.prototype.toLocaleString, "name", {
|
||||
value: "toLocaleString",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -16,6 +16,8 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyWritable(Object.prototype, "toString");
|
||||
verifyNotEnumerable(Object.prototype, "toString");
|
||||
verifyConfigurable(Object.prototype, "toString");
|
||||
verifyProperty(Object.prototype, "toString", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,8 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.prototype.valueOf.name, "valueOf");
|
||||
|
||||
verifyNotEnumerable(Object.prototype.valueOf, "name");
|
||||
verifyNotWritable(Object.prototype.valueOf, "name");
|
||||
verifyConfigurable(Object.prototype.valueOf, "name");
|
||||
verifyProperty(Object.prototype.valueOf, "name", {
|
||||
value: "valueOf",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -18,12 +18,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.setPrototypeOf.length,
|
||||
2,
|
||||
'The value of `Object.setPrototypeOf.length` is `2`'
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Object.setPrototypeOf, 'length');
|
||||
verifyNotWritable(Object.setPrototypeOf, 'length');
|
||||
verifyConfigurable(Object.setPrototypeOf, 'length');
|
||||
verifyProperty(Object.setPrototypeOf, "length", {
|
||||
value: 2,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -19,12 +19,9 @@ info: |
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.setPrototypeOf.name,
|
||||
'setPrototypeOf',
|
||||
'The value of `Object.setPrototypeOf.name` is `"setPrototypeOf"`'
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Object.setPrototypeOf, 'name');
|
||||
verifyNotWritable(Object.setPrototypeOf, 'name');
|
||||
verifyConfigurable(Object.setPrototypeOf, 'name');
|
||||
verifyProperty(Object.setPrototypeOf, "name", {
|
||||
value: "setPrototypeOf",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -12,6 +12,8 @@ includes: [propertyHelper.js]
|
|||
|
||||
assert.sameValue(typeof Object.setPrototypeOf, 'function');
|
||||
|
||||
verifyNotEnumerable(Object, 'setPrototypeOf');
|
||||
verifyWritable(Object, 'setPrototypeOf');
|
||||
verifyConfigurable(Object, 'setPrototypeOf');
|
||||
verifyProperty(Object, "setPrototypeOf", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,8 +8,9 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.values.length, 1, 'Expected Object.values.length to be 1');
|
||||
|
||||
verifyNotEnumerable(Object.values, 'length');
|
||||
verifyNotWritable(Object.values, 'length');
|
||||
verifyConfigurable(Object.values, 'length');
|
||||
verifyProperty(Object.values, "length", {
|
||||
value: 1,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,12 +8,9 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(
|
||||
Object.values.name,
|
||||
'values',
|
||||
'Expected Object.values.name to be "values"'
|
||||
);
|
||||
|
||||
verifyNotEnumerable(Object.values, 'name');
|
||||
verifyNotWritable(Object.values, 'name');
|
||||
verifyConfigurable(Object.values, 'name');
|
||||
verifyProperty(Object.values, "name", {
|
||||
value: "values",
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
|
@ -8,6 +8,8 @@ author: Jordan Harband
|
|||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(Object, 'values');
|
||||
verifyWritable(Object, 'values');
|
||||
verifyConfigurable(Object, 'values');
|
||||
verifyProperty(Object, "values", {
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue