mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 08:24:23 +02:00
Fix all test/harness/*.js tests (#1068)
$ test262-harness --hostType=d8 -t 4 --hostPath=`which d8` test/harness/*.js Ran 147 tests 147 passed 0 failed $ test262-harness --hostType=node -t 4 --hostPath=`which node` test/harness/*.js Ran 147 tests 147 passed 0 failed $ test262-harness --hostType=jsshell -t 4 --hostPath=`which js` test/harness/*.js Ran 147 tests 147 passed 0 failed Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
parent
0d2b3562e9
commit
1a2244faf8
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
`false` does not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
Two references to NaN do not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
An object literal does not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
Distinct objects do not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
Positive and negative zero do not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,13 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
The assertion fails when the code does not parse with an early error
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
// monkeypatch the API
|
||||
$ERROR = function $ERROR(message) {
|
||||
throw new Test262Error(message);
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, () => {
|
||||
assert.throws.early(ReferenceError, 'x = 1');
|
||||
});
|
||||
|
@ -5,6 +5,7 @@
|
||||
description: >
|
||||
Functions that throw values whose constructor does not match the specified
|
||||
constructor do not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -5,6 +5,7 @@
|
||||
description: >
|
||||
Functions that throw instances of the specified native Error constructor
|
||||
satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
assert.throws(Error, function() {
|
||||
|
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
The assertion fails when invoked without arguments.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
Functions that do not throw errors do not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
Fails if second arg is not a function
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,6 +4,7 @@
|
||||
/*---
|
||||
description: >
|
||||
Functions that throw the `null` value do not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
@ -4,8 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
Functions that throw primitive values do not satisfy the assertion.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
|
@ -4,8 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
The assertion fails when invoked with a single argument.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
|
@ -4,7 +4,7 @@
|
||||
description: >
|
||||
Only passes when the provided date is exactly the specified number of
|
||||
milliseconds from the Unix epoch
|
||||
includes: [assertRelativeDateMs.js]
|
||||
includes: [assertRelativeDateMs.js,sta.js]
|
||||
---*/
|
||||
|
||||
var thrown;
|
||||
|
@ -3,10 +3,10 @@
|
||||
|
||||
/*---
|
||||
description: >
|
||||
The global `$ERROR` function throws an instance of the global `Test262`
|
||||
The global `$ERROR` function throws an instance of the global `Test262Error`
|
||||
function with the specified message.
|
||||
includes: [sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
@ -25,5 +25,5 @@ try {
|
||||
}
|
||||
|
||||
if (threw === false) {
|
||||
throw new Error('Expected a Test262Error, but no error was thrown.');
|
||||
$ERROR('Expected a Test262Error, but no error was thrown.');
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
description: >
|
||||
Objects whose specified property is not configurable do not satisfy the
|
||||
assertion outside of strict mode.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
|
@ -5,10 +5,9 @@
|
||||
description: >
|
||||
Objects whose specified property is not configurable do not satisfy the
|
||||
assertion in strict mode.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -5,10 +5,9 @@
|
||||
description: |
|
||||
Objects whose specified symbol property is not enumerable do not satisfy the
|
||||
assertion.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
features: [Symbol]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
var s = Symbol('1');
|
||||
@ -29,7 +28,5 @@ try {
|
||||
}
|
||||
|
||||
if (threw === false) {
|
||||
throw new Test262Error(
|
||||
'Expected a Test262Error, but no error was thrown for symbol key.'
|
||||
);
|
||||
$ERROR('Expected a Test262Error, but no error was thrown.');
|
||||
}
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: |
|
||||
Objects whose specified string property is not enumerable do not satisfy the
|
||||
assertion.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
@ -27,7 +26,5 @@ try {
|
||||
}
|
||||
|
||||
if (threw === false) {
|
||||
throw new Test262Error(
|
||||
'Expected a Test262Error, but no error was thrown for string key.'
|
||||
);
|
||||
$ERROR('Expected a Test262Error, but no error was thrown.');
|
||||
}
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Objects whose specified property is configurable do not satisfy the
|
||||
assertion.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -5,10 +5,9 @@
|
||||
description: >
|
||||
Objects whose specified property is not configurable satisfy the assertion
|
||||
in strict mode.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
configurable: false
|
||||
|
@ -5,10 +5,9 @@
|
||||
description: |
|
||||
Objects whose specified symbol property is enumerable do not satisfy the
|
||||
assertion.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
features: [Symbol]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
var s = Symbol('1');
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: |
|
||||
Objects whose specified string property is enumerable do not satisfy the
|
||||
assertion.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -4,9 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
Objects whose specified property is writable do not satisfy the assertion.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -5,10 +5,9 @@
|
||||
description: >
|
||||
Objects whose specified property is not writable do not satisfy the
|
||||
assertion outside of strict mode.
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -5,9 +5,10 @@
|
||||
description: >
|
||||
Objects whose specified property is not writable do not satisfy the
|
||||
assertion in strict mode.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -6,7 +6,6 @@ description: >
|
||||
Objects whose specified property is writable satisfy the assertion.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Objects that are expected to be functions but do not define the correct
|
||||
[[Class]] internal property do not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Functions whose `length` property does not match the expected value do not
|
||||
satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Non-constructor functions that do not throw an when invoked via `new` do
|
||||
not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Non-constructor functions that do not throw a TypeError when invoked via
|
||||
`new` do not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var fn = function() {
|
||||
throw new Error();
|
||||
|
@ -4,9 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
Objects that are not extensible do not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.preventExtensions(obj);
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Objects that are not expected to be functions but do not define the correct
|
||||
[[Class]] internal property do not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Objects that do not define all of the specified "own" properties as
|
||||
non-enumerable do not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Objects that do not define all of the specified "own" properties do not
|
||||
satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Objects that do not define all of the specified "own" properties as
|
||||
configurable do not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -5,9 +5,8 @@
|
||||
description: >
|
||||
Objects that do not define all of the specified "own" properties as
|
||||
writable do not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'a', {
|
||||
|
@ -4,9 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
`undefined` does not satisfy the assertion.
|
||||
includes: [testBuiltInObject.js]
|
||||
includes: [testBuiltInObject.js,sta.js]
|
||||
---*/
|
||||
|
||||
var threw = false;
|
||||
|
||||
try {
|
||||
|
@ -4,14 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
verifyProperty should receive at least 3 arguments: obj, name, and descriptor
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
---*/
|
||||
|
||||
// monkeypatch the API
|
||||
$ERROR = function $ERROR(message) {
|
||||
throw new Test262Error(message);
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, () => {
|
||||
verifyProperty();
|
||||
}, "0 arguments");
|
||||
|
@ -4,14 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
The desc argument should be an object or undefined
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
---*/
|
||||
|
||||
// monkeypatch the API
|
||||
$ERROR = function $ERROR(message) {
|
||||
throw new Test262Error(message);
|
||||
};
|
||||
|
||||
var sample = { foo: 42 };
|
||||
|
||||
assert.throws(Test262Error, () => {
|
||||
|
@ -4,14 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
The first argument should have an own property
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
---*/
|
||||
|
||||
// monkeypatch the API
|
||||
$ERROR = function $ERROR(message) {
|
||||
throw new Test262Error(message);
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, () => {
|
||||
verifyProperty(Object, 'JeanPaulSartre', {});
|
||||
}, "inexisting property");
|
||||
|
@ -4,14 +4,8 @@
|
||||
/*---
|
||||
description: >
|
||||
Verify an undefined descriptor
|
||||
includes: [propertyHelper.js]
|
||||
includes: [propertyHelper.js,sta.js]
|
||||
---*/
|
||||
|
||||
// monkeypatch the API
|
||||
$ERROR = function $ERROR(message) {
|
||||
throw new Test262Error(message);
|
||||
};
|
||||
|
||||
var sample = {
|
||||
bar: undefined,
|
||||
get baz() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user