mirror of https://github.com/tc39/test262.git
harness/*: Eliminate unnecessary uses of features that would require "features: ..." tags
This commit is contained in:
parent
65424be3ef
commit
8a2ec34200
|
@ -88,8 +88,8 @@ assert.throws = function (expectedErrorConstructor, func, message) {
|
|||
};
|
||||
|
||||
assert.throws.early = function(err, code) {
|
||||
let wrappedCode = `function wrapperFn() { ${code} }`;
|
||||
let wrappedCode = 'function wrapperFn() { ' + code + ' }';
|
||||
let ieval = eval;
|
||||
|
||||
assert.throws(err, function() { Function(wrappedCode); }, `Function: ${code}`);
|
||||
assert.throws(err, function() { Function(wrappedCode); }, 'Function: ' + code);
|
||||
};
|
||||
|
|
|
@ -20,5 +20,5 @@ function compareArray(a, b) {
|
|||
|
||||
assert.compareArray = function(actual, expected, message) {
|
||||
assert(compareArray(actual, expected),
|
||||
`Expected [${actual.join(", ")}] and [${expected.join(", ")}] to have the same contents. ${message}`);
|
||||
'Expected [' + actual.join(', ') + '] and [' + expected.join(', ') + '] to have the same contents. ' + message);
|
||||
};
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
propertyHelper.js: [template]
|
||||
typeCoercion.js: [Symbol.toPrimitive,BigInt]
|
||||
typeCoercion.js: [Symbol.toPrimitive, BigInt]
|
||||
testAtomics.js: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, arrow-function, let, for-of]
|
||||
testTypedArray.js: [TypedArray]
|
||||
|
|
|
@ -20,7 +20,7 @@ function verifyProperty(obj, name, desc, options) {
|
|||
assert.sameValue(
|
||||
originalDesc,
|
||||
undefined,
|
||||
`obj['${nameStr}'] descriptor should be undefined`
|
||||
"obj['" + nameStr + "'] descriptor should be undefined"
|
||||
);
|
||||
|
||||
// desc and originalDesc are both undefined, problem solved;
|
||||
|
@ -29,47 +29,47 @@ function verifyProperty(obj, name, desc, options) {
|
|||
|
||||
assert(
|
||||
Object.prototype.hasOwnProperty.call(obj, name),
|
||||
`obj should have an own property ${nameStr}`
|
||||
"obj should have an own property " + nameStr
|
||||
);
|
||||
|
||||
assert.notSameValue(
|
||||
desc,
|
||||
null,
|
||||
`The desc argument should be an object or undefined, null`
|
||||
"The desc argument should be an object or undefined, null"
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
typeof desc,
|
||||
"object",
|
||||
`The desc argument should be an object or undefined, ${String(desc)}`
|
||||
"The desc argument should be an object or undefined, " + String(desc)
|
||||
);
|
||||
|
||||
var failures = [];
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(desc, 'value')) {
|
||||
if (desc.value !== originalDesc.value) {
|
||||
failures.push(`descriptor value should be ${desc.value}`);
|
||||
failures.push("descriptor value should be " + desc.value);
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(desc, 'enumerable')) {
|
||||
if (desc.enumerable !== originalDesc.enumerable ||
|
||||
desc.enumerable !== isEnumerable(obj, name)) {
|
||||
failures.push(`descriptor should ${desc.enumerable ? '' : 'not '}be enumerable`);
|
||||
failures.push('descriptor should ' + (desc.enumerable ? '' : 'not ') + 'be enumerable');
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(desc, 'writable')) {
|
||||
if (desc.writable !== originalDesc.writable ||
|
||||
desc.writable !== isWritable(obj, name)) {
|
||||
failures.push(`descriptor should ${desc.writable ? '' : 'not '}be writable`);
|
||||
failures.push('descriptor should ' + (desc.writable ? '' : 'not ') + 'be writable');
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(desc, 'configurable')) {
|
||||
if (desc.configurable !== originalDesc.configurable ||
|
||||
desc.configurable !== isConfigurable(obj, name)) {
|
||||
failures.push(`descriptor should ${desc.configurable ? '' : 'not '}be configurable`);
|
||||
failures.push('descriptor should ' + (desc.configurable ? '' : 'not ') + 'be configurable');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue