mirror of https://github.com/tc39/test262.git
Make asynchronous test configuration explicit
For asynchronous tests, the contract between test file and test runner is implicit: runners are expected to inspect the source code for references to a global `$DONE` identifier. Promote a more explicit contract between test file and test runner by introducing a new frontmatter "tag", `async`. This brings asynchronous test configuration in-line with other configuration mechanisms and also provides a more natural means of test filtering. The modifications to test files was made programatically using the `grep` and `sed` utilities: $ grep "\$DONE" test/ -r --files-with-match --null | \ xargs -0 sed -i 's/^\(flags:\s*\)\[/\1[async, /g' $ grep "\$DONE" test/ -rl --null | \ xargs -0 grep -E '^flags:' --files-without-match --null | \ xargs -0 sed -i 's/^---\*\//flags: [async]\n---*\//'
This commit is contained in:
parent
5cb97c293b
commit
23d566209a
|
@ -128,6 +128,8 @@ This tag is for boolean properties associated with the test.
|
|||
- **`raw`** - execute the test without any modification (no helpers will be
|
||||
available); necessary to test the behavior of directive prologue; implies
|
||||
`noStrict`
|
||||
- **`async`** - defer interpretation of test results until after the invocation
|
||||
of the global $DONE` function
|
||||
|
||||
#### features
|
||||
**features**: [list]
|
||||
|
@ -198,7 +200,7 @@ assert.throws(ReferenceError, function() {
|
|||
|
||||
## Writing Asynchronous Tests
|
||||
|
||||
An asynchronous test is any test that includes the string `$DONE` anywhere in the test file. The test runner checks for the presence of this string; if it is found, the runner expects that the `$DONE()` function will be called to signal test completion.
|
||||
An asynchronous test is any test that include the `async` frontmatter flag. When executing such tests, the runner expects that the global `$DONE()` function will be called to signal test completion.
|
||||
|
||||
* If the argument to `$DONE` is omitted, is `undefined`, or is any other falsy value, the test is considered to have passed.
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ info: >
|
|||
es6id: S25.4.3.1_A2.3_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.call(resolved Promise) throws TypeError
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p = new Promise(function(resolve) { resolve(1); });
|
||||
|
|
|
@ -7,6 +7,7 @@ info: >
|
|||
es6id: S25.4.3.1_A2.4_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.call(rejected Promise) throws TypeError
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p = new Promise(function(resolve, reject) { reject(1) });
|
||||
|
|
|
@ -8,6 +8,7 @@ info: >
|
|||
es6id: S25.4.3.1_A4.1_T1
|
||||
author: Sam Mikes
|
||||
description: new Promise(function () { throw }) should reject
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var errorObject = {},
|
||||
|
|
|
@ -9,7 +9,7 @@ info: >
|
|||
es6id: S25.4.3.1_A5.1_T1
|
||||
author: Sam Mikes
|
||||
description: Promise executor gets default handling for 'this'
|
||||
flags: [noStrict]
|
||||
flags: [async, noStrict]
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ info: >
|
|||
es6id: S25.4.3.1_A5.1_T2
|
||||
author: Sam Mikes
|
||||
description: Promise executor gets default handling for 'this'
|
||||
flags: [onlyStrict]
|
||||
flags: [async, onlyStrict]
|
||||
---*/
|
||||
|
||||
var expectedThis = undefined;
|
||||
|
|
|
@ -7,6 +7,7 @@ es6id: 25.4.4.1_A2.2_T1
|
|||
author: Sam Mikes
|
||||
includes: [PromiseHelper.js]
|
||||
description: Promise.all([]) returns immediately
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [];
|
||||
|
|
|
@ -6,6 +6,7 @@ info: Promise.all([]) returns a promise for a new empty array
|
|||
es6id: 25.4.4.1_A2.3_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.all([]) returns a promise for an array
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var arg = [];
|
||||
|
|
|
@ -6,6 +6,7 @@ info: Promise.all is resolved with a new empty array
|
|||
es6id: 25.4.4.1_A2.3_T2
|
||||
author: Sam Mikes
|
||||
description: Promise.all([]) returns a Promise for an empty array
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var arg = [];
|
||||
|
|
|
@ -6,6 +6,7 @@ info: Promise.all([]) is resolved with Promise for a new empty array
|
|||
es6id: 25.4.4.1_A2.3_T3
|
||||
author: Sam Mikes
|
||||
description: Promise.all([]) is resolved with a Promise for a new array
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var arg = [];
|
||||
|
|
|
@ -9,6 +9,7 @@ info: >
|
|||
es6id: 25.4.4.1_A3.1_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.all(3) returns Promise rejected with TypeError
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var nonIterable = 3;
|
||||
|
|
|
@ -10,6 +10,7 @@ info: >
|
|||
es6id: S25.4.4.1_A3.1_T2
|
||||
author: Sam Mikes
|
||||
description: Promise.all(new Error()) returns Promise rejected with TypeError
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
Promise.all(new Error("abrupt")).then(function () {
|
||||
|
|
|
@ -9,6 +9,7 @@ es6id: S25.4.4.1_A3.1_T3
|
|||
author: Sam Mikes
|
||||
description: Promise.all((throw on GetIterator)) returns Promise rejected with TypeError
|
||||
features: [Symbol.iterator]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var iterThrows = {};
|
||||
|
|
|
@ -9,6 +9,7 @@ es6id: S25.4.4.1_A5.1_T1
|
|||
author: Sam Mikes
|
||||
description: iterator.next throws, causing Promise.all to reject
|
||||
features: [Symbol.iterator]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var iterThrows = {};
|
||||
|
|
|
@ -8,6 +8,7 @@ info: >
|
|||
es6id: S25.4.4.1_A6.1_T2
|
||||
author: Sam Mikes
|
||||
description: Promise.all([]) returns a promise for an empty array
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p = Promise.all([]);
|
||||
|
|
|
@ -8,6 +8,7 @@ info: >
|
|||
es6id: S25.4.4.1_A6.1_T2
|
||||
author: Sam Mikes
|
||||
description: Promise.all([p1]) is resolved with a promise for a one-element array
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p1 = Promise.resolve(3);
|
||||
|
|
|
@ -9,6 +9,7 @@ es6id: S25.4.4.1_A7.2_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.all() accepts a one-element array
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [];
|
||||
|
|
|
@ -6,6 +6,7 @@ es6id: S25.4.4.1_A8.1_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.all([p1, p2]) resolution functions are called in predictable sequence
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [];
|
||||
|
|
|
@ -8,6 +8,7 @@ es6id: S25.4.4.1_A8.1_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.all() rejects when a promise in its array rejects
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var rejectP1,
|
||||
|
|
|
@ -8,6 +8,7 @@ es6id: S25.4.4.1_A8.2_T2
|
|||
author: Sam Mikes
|
||||
description: Promise.all() rejects when second promise in array rejects
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var rejectP2,
|
||||
|
|
|
@ -24,6 +24,7 @@ info: >
|
|||
a. Let status be CreateDataProperty(array, ToString(n), e).
|
||||
b. Assert: status is true.
|
||||
...
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
Object.defineProperty(Array.prototype, 0, {
|
||||
|
|
|
@ -21,6 +21,7 @@ info: >
|
|||
[...]
|
||||
i. Let nextPromise be Invoke(constructor, "resolve", «nextValue»).
|
||||
j. ReturnIfAbrupt(nextPromise ).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var error = new Test262Error();
|
||||
|
|
|
@ -22,6 +22,7 @@ info: >
|
|||
r. Let result be Invoke(nextPromise, "then", «resolveElement,
|
||||
resultCapability.[[Reject]]»).
|
||||
s. ReturnIfAbrupt(result).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var promise = new Promise(function() {});
|
||||
|
|
|
@ -24,6 +24,7 @@ info: >
|
|||
true.
|
||||
g. ReturnIfAbrupt(nextValue).
|
||||
features: [Symbol.iterator]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var iterNextValThrows = {};
|
||||
|
|
|
@ -23,6 +23,7 @@ info: >
|
|||
true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
features: [Symbol.iterator]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var iterStepThrows = {};
|
||||
|
|
|
@ -20,6 +20,7 @@ info: >
|
|||
25.4.1.3.1 Promise Reject Functions
|
||||
[...]
|
||||
6. Return RejectPromise(promise, reason).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var thenable = {
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
3. Let alreadyResolved be the value of F's [[AlreadyResolved]] internal
|
||||
slot.
|
||||
4. If alreadyResolved.[[value]] is true, return undefined.
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var fulfiller = {
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
3. Let alreadyResolved be the value of F's [[AlreadyResolved]] internal
|
||||
slot.
|
||||
4. If alreadyResolved.[[value]] is true, return undefined.
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var fulfiller = {
|
||||
|
|
|
@ -20,6 +20,7 @@ info: >
|
|||
25.4.1.3.1 Promise Reject Functions
|
||||
[...]
|
||||
6. Return RejectPromise(promise, reason).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var thenable = {
|
||||
|
|
|
@ -31,6 +31,7 @@ info: >
|
|||
10. Let thenAction be then.[[value]].
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var v1 = {};
|
||||
|
|
|
@ -40,6 +40,7 @@ info: >
|
|||
8. Let then be Get(resolution, "then").
|
||||
9. If then is an abrupt completion, then
|
||||
a. Return RejectPromise(promise, then.[[value]]).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -45,6 +45,7 @@ info: >
|
|||
[...]
|
||||
12. Perform EnqueueJob ("PromiseJobs", PromiseResolveThenableJob,
|
||||
«promise, resolution, thenAction»)
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -15,6 +15,7 @@ info: >
|
|||
a. Let status be Call(resolvingFunctions.[[Reject]], undefined, «completion.[[value]]»).
|
||||
b. ReturnIfAbrupt(status).
|
||||
...
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var thenable = {
|
||||
|
|
|
@ -14,6 +14,7 @@ info: >
|
|||
a. Let status be Call(resolvingFunctions.[[Reject]], undefined, «thenCallResult.[[value]]»)
|
||||
b. NextJob Completion(status).
|
||||
...
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var thenable = {
|
||||
|
|
|
@ -7,6 +7,7 @@ info: >
|
|||
es6id: S25.4.5.1_A3.1_T1
|
||||
author: Sam Mikes
|
||||
description: catch is implemented in terms of then
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
|
|
@ -7,6 +7,7 @@ info: >
|
|||
es6id: S25.4.5.1_A3.1_T2
|
||||
author: Sam Mikes
|
||||
description: catch is implemented in terms of then
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
|
|
@ -9,6 +9,7 @@ es6id: S25.4.2.1_A3.2_T2
|
|||
author: Sam Mikes
|
||||
description: Promise onResolved functions are called in predictable sequence
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [];
|
||||
|
|
|
@ -10,6 +10,7 @@ es6id: S25.4.4_A2.1_T1
|
|||
author: Sam Mikes
|
||||
description: Promise onResolved functions are called in predictable sequence
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var resolveP1, rejectP2, sequence = [];
|
||||
|
|
|
@ -10,6 +10,7 @@ es6id: S25.4.4_A2.1_T2
|
|||
author: Sam Mikes
|
||||
description: Promise onResolved functions are called in predictable sequence
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var resolveP1, rejectP2, p1, p2,
|
||||
|
|
|
@ -10,6 +10,7 @@ es6id: S25.4.4_A2.1_T3
|
|||
author: Sam Mikes
|
||||
description: Promise onResolved functions are called in predictable sequence
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var resolveP1, rejectP2, p1, p2,
|
||||
|
|
|
@ -8,6 +8,7 @@ info: >
|
|||
es6id: S25.4.5.3_A4.1_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.prototype.then accepts 'undefined' as arg1, arg2
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
|
|
@ -8,6 +8,7 @@ info: >
|
|||
es6id: S25.4.5.3_A4.1_T2
|
||||
author: Sam Mikes
|
||||
description: Promise.prototype.then accepts 'undefined' as arg1, arg2
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
|
|
@ -8,6 +8,7 @@ info: >
|
|||
es6id: S25.4.5.3_A4.2_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.prototype.then treats non-callable arg1, arg2 as undefined
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
|
|
@ -8,6 +8,7 @@ info: >
|
|||
es6id: S25.4.5.3_A4.2_T2
|
||||
author: Sam Mikes
|
||||
description: Promise.prototype.then treats non-callable arg1, arg2 as undefined
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
|
|
@ -9,6 +9,7 @@ es6id: S25.4.5.3_A5.1_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.prototype.then enqueues handler if pending
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [],
|
||||
|
|
|
@ -9,6 +9,7 @@ es6id: S25.4.5.3_A5.2_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.prototype.then immediately queues handler if fulfilled
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [],
|
||||
|
|
|
@ -9,6 +9,7 @@ es6id: S25.4.5.3_A5.3_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.prototype.then immediately queues handler if rejected
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [],
|
||||
|
|
|
@ -34,6 +34,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined, «handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
features: [class]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var createBadPromise = false;
|
||||
|
|
|
@ -16,6 +16,7 @@ info: >
|
|||
b. Perform EnqueueJob("PromiseJobs", PromiseReactionJob,
|
||||
«fulfillReaction, value»).
|
||||
[...]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -16,6 +16,7 @@ info: >
|
|||
b. Append rejectReaction as the last element of the List that is the
|
||||
value of promise's [[PromiseRejectReactions]] internal slot.
|
||||
[...]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -16,6 +16,7 @@ info: >
|
|||
b. Append rejectReaction as the last element of the List that is the
|
||||
value of promise's [[PromiseRejectReactions]] internal slot.
|
||||
[...]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -16,6 +16,7 @@ info: >
|
|||
b. Perform EnqueueJob("PromiseJobs", PromiseReactionJob,
|
||||
«rejectReaction, reason»).
|
||||
[...]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -18,6 +18,7 @@ info: >
|
|||
25.4.1.3.1 Promise Reject Functions
|
||||
[...]
|
||||
6. Return RejectPromise(promise, reason).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var resolve;
|
||||
|
|
|
@ -19,6 +19,7 @@ info: >
|
|||
25.4.1.3.1 Promise Reject Functions
|
||||
[...]
|
||||
6. Return RejectPromise(promise, reason).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var reject;
|
||||
|
|
|
@ -26,6 +26,7 @@ info: >
|
|||
25.4.1.3.1 Promise Reject Functions
|
||||
[...]
|
||||
6. Return RejectPromise(promise, reason).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var thenable = new Promise(function(resolve) { resolve(); });
|
||||
|
|
|
@ -26,6 +26,7 @@ info: >
|
|||
25.4.1.3.1 Promise Reject Functions
|
||||
[...]
|
||||
6. Return RejectPromise(promise, reason).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var thenable = new Promise(function(resolve) { resolve(); });
|
||||
|
|
|
@ -18,6 +18,7 @@ info: >
|
|||
25.4.1.3.2 Promise Resolve Functions
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var resolve;
|
||||
|
|
|
@ -23,6 +23,7 @@ info: >
|
|||
10. Let thenAction be then.[[value]].
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var nonThenable = { then: null };
|
||||
|
|
|
@ -20,6 +20,7 @@ info: >
|
|||
8. Let then be Get(resolution, "then").
|
||||
9. If then is an abrupt completion, then
|
||||
a. Return RejectPromise(promise, then.[[value]]).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -20,6 +20,7 @@ info: >
|
|||
6. If SameValue(resolution, promise) is true, then
|
||||
a. Let selfResolutionError be a newly created TypeError object.
|
||||
b. Return RejectPromise(promise, selfResolutionError).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var resolve;
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
[...]
|
||||
12. Perform EnqueueJob ("PromiseJobs", PromiseResolveThenableJob,
|
||||
«promise, resolution, thenAction»)
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -19,6 +19,7 @@ info: >
|
|||
25.4.1.3.2 Promise Resolve Functions
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var reject;
|
||||
|
|
|
@ -24,6 +24,7 @@ info: >
|
|||
10. Let thenAction be then.[[value]].
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var nonThenable = { then: null };
|
||||
|
|
|
@ -21,6 +21,7 @@ info: >
|
|||
8. Let then be Get(resolution, "then").
|
||||
9. If then is an abrupt completion, then
|
||||
a. Return RejectPromise(promise, then.[[value]]).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -21,6 +21,7 @@ info: >
|
|||
6. If SameValue(resolution, promise) is true, then
|
||||
a. Let selfResolutionError be a newly created TypeError object.
|
||||
b. Return RejectPromise(promise, selfResolutionError).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var reject;
|
||||
|
|
|
@ -26,6 +26,7 @@ info: >
|
|||
[...]
|
||||
12. Perform EnqueueJob ("PromiseJobs", PromiseResolveThenableJob,
|
||||
«promise, resolution, thenAction»)
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
25.4.1.3.2 Promise Resolve Functions
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p1 = new Promise(function(resolve) { resolve(); });
|
||||
|
|
|
@ -30,6 +30,7 @@ info: >
|
|||
10. Let thenAction be then.[[value]].
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var nonThenable = { then: null };
|
||||
|
|
|
@ -27,6 +27,7 @@ info: >
|
|||
8. Let then be Get(resolution, "then").
|
||||
9. If then is an abrupt completion, then
|
||||
a. Return RejectPromise(promise, then.[[value]]).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -27,6 +27,7 @@ info: >
|
|||
6. If SameValue(resolution, promise) is true, then
|
||||
a. Let selfResolutionError be a newly created TypeError object.
|
||||
b. Return RejectPromise(promise, selfResolutionError).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p1 = new Promise(function(resolve) { resolve(); });
|
||||
|
|
|
@ -32,6 +32,7 @@ info: >
|
|||
[...]
|
||||
12. Perform EnqueueJob ("PromiseJobs", PromiseResolveThenableJob,
|
||||
«promise, resolution, thenAction»)
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
25.4.1.3.2 Promise Resolve Functions
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p1 = new Promise(function(_, reject) { reject(); });
|
||||
|
|
|
@ -30,6 +30,7 @@ info: >
|
|||
10. Let thenAction be then.[[value]].
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var nonThenable = { then: null };
|
||||
|
|
|
@ -27,6 +27,7 @@ info: >
|
|||
8. Let then be Get(resolution, "then").
|
||||
9. If then is an abrupt completion, then
|
||||
a. Return RejectPromise(promise, then.[[value]]).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -27,6 +27,7 @@ info: >
|
|||
6. If SameValue(resolution, promise) is true, then
|
||||
a. Let selfResolutionError be a newly created TypeError object.
|
||||
b. Return RejectPromise(promise, selfResolutionError).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p1 = new Promise(function(_, reject) { reject(); });
|
||||
|
|
|
@ -32,6 +32,7 @@ info: >
|
|||
[...]
|
||||
12. Perform EnqueueJob ("PromiseJobs", PromiseResolveThenableJob,
|
||||
«promise, resolution, thenAction»)
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -9,7 +9,7 @@ es6id: S25.4.2.1_A3.1_T1
|
|||
author: Sam Mikes
|
||||
description: >
|
||||
"fulfilled" handler invoked correctly outside of strict mode
|
||||
flags: [noStrict]
|
||||
flags: [async, noStrict]
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ es6id: S25.4.2.1_A3.1_T2
|
|||
author: Sam Mikes
|
||||
description: >
|
||||
"fulfilled" handler invoked correctly in strict mode
|
||||
flags: [onlyStrict]
|
||||
flags: [async, onlyStrict]
|
||||
---*/
|
||||
|
||||
var expectedThis = undefined,
|
||||
|
|
|
@ -12,6 +12,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined,
|
||||
«handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var promise = new Promise(function(resolve) {
|
||||
|
|
|
@ -12,6 +12,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined,
|
||||
«handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var promise = new Promise(function(resolve) {
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined,
|
||||
«handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined,
|
||||
«handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -7,6 +7,7 @@ info: >
|
|||
es6id: S25.4.2.1_A1.1_T1
|
||||
author: Sam Mikes
|
||||
description: argument passes through "Identity"
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
|
|
@ -9,7 +9,7 @@ es6id: S25.4.2.1_A3.2_T1
|
|||
author: Sam Mikes
|
||||
description: >
|
||||
"rejected" handler invoked correctly outside of strict mode
|
||||
flags: [noStrict]
|
||||
flags: [async, noStrict]
|
||||
includes: [fnGlobalObject.js]
|
||||
---*/
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ es6id: S25.4.2.1_A3.2_T2
|
|||
author: Sam Mikes
|
||||
description: >
|
||||
"rejected" handler invoked correctly in strict mode
|
||||
flags: [onlyStrict]
|
||||
flags: [async, onlyStrict]
|
||||
---*/
|
||||
|
||||
var expectedThis = undefined,
|
||||
|
|
|
@ -12,6 +12,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined,
|
||||
«handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var promise = new Promise(function(_, reject) {
|
||||
|
|
|
@ -12,6 +12,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined,
|
||||
«handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var promise = new Promise(function(_, reject) {
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined,
|
||||
«handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -25,6 +25,7 @@ info: >
|
|||
8. Let status be Call(promiseCapability.[[Resolve]], undefined,
|
||||
«handlerResult.[[value]]»).
|
||||
9. NextJob Completion(status).
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
|
|
|
@ -7,6 +7,7 @@ info: >
|
|||
es6id: S25.4.2.1_A2.1_T1
|
||||
author: Sam Mikes
|
||||
description: argument thrown through "Thrower"
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var obj = {};
|
||||
|
|
|
@ -6,6 +6,7 @@ info: Promise.race rejects on non-iterable argument
|
|||
es6id: S25.4.4.3_A2.2_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.race rejects if argument is not object or is non-iterable
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var nonIterable = 3;
|
||||
|
|
|
@ -6,6 +6,7 @@ info: Promise.race rejects on non-iterable argument
|
|||
es6id: S25.4.4.3_A2.2_T2
|
||||
author: Sam Mikes
|
||||
description: Promise.race rejects if argument is not object or is non-iterable
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
Promise.race(new Error("abrupt")).then(function () {
|
||||
|
|
|
@ -10,6 +10,7 @@ es6id: S25.4.4.3_A2.2_T3
|
|||
author: Sam Mikes
|
||||
description: Promise.race rejects if GetIterator throws
|
||||
features: [Symbol.iterator]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var iterThrows = {};
|
||||
|
|
|
@ -6,6 +6,7 @@ es6id: S25.4.4.3_A4.1_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.race rejects if IteratorStep throws
|
||||
features: [Symbol.iterator]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var iterThrows = {};
|
||||
|
|
|
@ -6,6 +6,7 @@ es6id: S25.4.4.3_A4.1_T2
|
|||
author: Sam Mikes
|
||||
description: Promise.race rejects if IteratorStep throws
|
||||
features: [Symbol.iterator]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var iterThrows = {};
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
es6id: S25.4.4.3_A5.1_T1
|
||||
author: Sam Mikes
|
||||
description: Promise.race([]) never settles
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var p = Promise.race([]);
|
||||
|
|
|
@ -6,6 +6,7 @@ es6id: S25.4.4.3_A6.1_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.race([1]) settles immediately
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [];
|
||||
|
|
|
@ -6,6 +6,7 @@ es6id: S25.4.4.3_A6.2_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.race([p1]) settles immediately
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [];
|
||||
|
|
|
@ -6,6 +6,7 @@ es6id: S25.4.4.3_A7.1_T1
|
|||
author: Sam Mikes
|
||||
description: Promise.race([p1, p2]) settles when first settles
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [];
|
||||
|
|
|
@ -6,6 +6,7 @@ es6id: S25.4.4.3_A7.1_T2
|
|||
author: Sam Mikes
|
||||
description: Promise.race([p1, p2]) settles when first settles
|
||||
includes: [PromiseHelper.js]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
var sequence = [];
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue