mirror of https://github.com/tc39/test262.git
Fix typos in calls to verifyProperty
And update verifyProperty to catch misspelled descriptor fields.
This commit is contained in:
parent
b4f72feb52
commit
534decc36d
|
@ -45,6 +45,19 @@ function verifyProperty(obj, name, desc, options) {
|
|||
return true;
|
||||
}
|
||||
|
||||
var names = Object.getOwnPropertyNames(desc);
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
assert(
|
||||
names[i] === "value" ||
|
||||
names[i] === "writable" ||
|
||||
names[i] === "enumerable" ||
|
||||
names[i] === "configurable" ||
|
||||
names[i] === "get" ||
|
||||
names[i] === "set",
|
||||
"Invalid descriptor field: " + names[i],
|
||||
);
|
||||
}
|
||||
|
||||
assert(
|
||||
Object.prototype.hasOwnProperty.call(obj, name),
|
||||
"obj should have an own property " + nameStr
|
||||
|
|
|
@ -22,6 +22,6 @@ includes: [propertyHelper.js]
|
|||
verifyProperty(ArrayBuffer.prototype.transfer, 'name', {
|
||||
value: 'transfer',
|
||||
enumerable: false,
|
||||
wrtiable: false,
|
||||
writable: false,
|
||||
configurable: true
|
||||
});
|
||||
|
|
|
@ -22,6 +22,6 @@ includes: [propertyHelper.js]
|
|||
verifyProperty(ArrayBuffer.prototype.transferToFixedLength, 'name', {
|
||||
value: 'transferToFixedLength',
|
||||
enumerable: false,
|
||||
wrtiable: false,
|
||||
writable: false,
|
||||
configurable: true
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ var error = new Error(message, { cause });
|
|||
verifyProperty(error, "cause", {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writeable: true,
|
||||
writable: true,
|
||||
value: cause,
|
||||
});
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ var error = new AggregateError(errors, message, { cause });
|
|||
verifyProperty(error, "cause", {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writeable: true,
|
||||
writable: true,
|
||||
value: cause,
|
||||
});
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ for (var i = 0; i < nativeErrors.length; ++i) {
|
|||
verifyProperty(error, "cause", {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writeable: true,
|
||||
writable: true,
|
||||
value: cause,
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue