Merge pull request #2675 from tc39/use-then-done-done

Use .then($DONE, $DONE) wherever possible
This commit is contained in:
Leo Balter 2020-06-24 12:58:46 -07:00 committed by GitHub
commit 3fac29109a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
478 changed files with 510 additions and 510 deletions

View File

@ -32,4 +32,4 @@ ctorPromise.then(() => {
assert.sameValue(value, 42, 'return from generator method');
assert.sameValue(done, true, 'iterator is done');
});
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -27,4 +27,4 @@ ctorPromise.then(() => {
return c.ref().then(value => {
assert.sameValue(value, 42, 'function return');
});
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -41,4 +41,4 @@ c.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -40,4 +40,4 @@ c.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -41,4 +41,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -40,4 +40,4 @@ C.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -41,4 +41,4 @@ c.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -40,4 +40,4 @@ c.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -41,4 +41,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -40,4 +40,4 @@ C.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -113,4 +113,4 @@ Promise.all([
assert.sameValue(results[4].value, 1);
assert.sameValue(results[5].value, 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -113,5 +113,5 @@ Promise.all([
assert.sameValue(results[4].value, 1);
assert.sameValue(results[5].value, 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -113,4 +113,4 @@ Promise.all([
assert.sameValue(results[4], 1);
assert.sameValue(results[5], 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -113,5 +113,5 @@ Promise.all([
assert.sameValue(results[4], 1);
assert.sameValue(results[5], 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -28,5 +28,5 @@ iter.next().then(result => {
assert.sameValue(result.value, undefined);
assert.sameValue(result.done, true);
assert.sameValue(x, 4);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);
}, $DONE).catch($DONE);

View File

@ -29,5 +29,5 @@ iter.next().then(result => {
assert.sameValue(result.value, undefined);
assert.sameValue(result.done, true);
assert.sameValue(x.prop, 22);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);
}, $DONE).catch($DONE);

View File

@ -27,5 +27,5 @@ iter.next().then(result => {
assert.sameValue(result.value, undefined);
assert.sameValue(result.done, true);
assert.sameValue(x, 4);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);
}, $DONE).catch($DONE);

View File

@ -57,4 +57,4 @@ Promise.all([
assert.sameValue(outcomes[0], 'timed-out');
assert.sameValue(outcomes[1], 'timed-out');
assert.sameValue(outcomes[2], 'timed-out');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -67,6 +67,6 @@ Promise.all([
'C not-equal,not-equal,not-equal,not-equal,not-equal',
'All C values are not equal'
);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -25,4 +25,4 @@ Promise.all([Atomics.waitAsync(i64a, 0, 0n, -1).value]).then(([outcome]) => {
'timed-out',
'Atomics.waitAsync(i64a, 0, 0n, -1).value resolves to "timed-out"'
);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -59,4 +59,4 @@ Promise.all([
assert.sameValue(outcomes[0], 'timed-out');
assert.sameValue(outcomes[1], 'timed-out');
assert.sameValue(outcomes[2], 'timed-out');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -68,4 +68,4 @@ Promise.all([
assert.sameValue(outcomes[0], 'timed-out');
assert.sameValue(outcomes[1], 'timed-out');
assert.sameValue(outcomes[2], 'timed-out');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -41,4 +41,4 @@ Promise.all([
assert.sameValue(outcomes[0], 'timed-out');
assert.sameValue(outcomes[1], 'timed-out');
assert.sameValue(outcomes[2], 'timed-out');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -57,4 +57,4 @@ Promise.all([
assert.sameValue(outcomes[1], 'ok');
assert.sameValue(outcomes[2], 'ok');
assert.sameValue(outcomes[3], 'ok');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -40,4 +40,4 @@ const toPrimitive = {
Promise.all([Atomics.store(i64a, 0, 42n), Atomics.waitAsync(i64a, 0, 0n).value]).then(outcomes => {
assert.sameValue(outcomes[0], 42n);
assert.sameValue(outcomes[1], 'not-equal');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -60,4 +60,4 @@ Promise.all([
assert.sameValue(outcomes[0], 'timed-out');
assert.sameValue(outcomes[1], 'timed-out');
assert.sameValue(outcomes[2], 'timed-out');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -66,5 +66,5 @@ Promise.all([
'C not-equal,not-equal,not-equal,not-equal,not-equal',
'All C values are not equal'
);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,4 +30,4 @@ Promise.all([
'timed-out',
'Atomics.waitAsync(i32a, 0, 0, -1).value resolves to "timed-out"'
);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -60,4 +60,4 @@ Promise.all([
assert.sameValue(outcomes[0], "timed-out");
assert.sameValue(outcomes[1], "timed-out");
assert.sameValue(outcomes[2], "timed-out");
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -69,4 +69,4 @@ Promise.all([
assert.sameValue(outcomes[0], "timed-out");
assert.sameValue(outcomes[1], "timed-out");
assert.sameValue(outcomes[2], "timed-out");
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -44,4 +44,4 @@ Promise.all([
assert.sameValue(outcomes[0], 'timed-out');
assert.sameValue(outcomes[1], 'timed-out');
assert.sameValue(outcomes[2], 'timed-out');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -60,4 +60,4 @@ Promise.all([
assert.sameValue(outcomes[1], 'ok');
assert.sameValue(outcomes[2], 'ok');
assert.sameValue(outcomes[3], 'ok');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -46,4 +46,4 @@ Promise.all([
]).then(outcomes => {
assert.sameValue(outcomes[0], 42);
assert.sameValue(outcomes[1], 'not-equal');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.all.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.all(values)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.all(values)
.then(() => {
assert.sameValue(callCount, 3, '`Promise.resolve` invoked once for every iterated value');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.allSettled.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.allSettled(values)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.allSettled(values)
.then(() => {
assert.sameValue(callCount, 3, '`Promise.resolve` invoked once for every iterated value');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.any.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.any(values)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.any.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.any(values)
.then(() => {
assert.sameValue(callCount, 3, '`Promise.resolve` invoked once for every iterated value');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -38,4 +38,4 @@ promises.forEach(promise => {
Promise.any(promises)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated value');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.race.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every item in iterable arg');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.race(values)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every item in iterable arg');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.race(values)
.then(() => {
assert.sameValue(callCount, 3, '`Promise.resolve` invoked once for every item in iterable arg');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -127,4 +127,4 @@ Promise.all([
assert.sameValue(results[4].value, 1);
assert.sameValue(results[5].value, 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -127,5 +127,5 @@ Promise.all([
assert.sameValue(results[4].value, 1);
assert.sameValue(results[5].value, 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -127,4 +127,4 @@ Promise.all([
assert.sameValue(results[4], 1);
assert.sameValue(results[5], 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -127,5 +127,5 @@ Promise.all([
assert.sameValue(results[4], 1);
assert.sameValue(results[5], 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -127,4 +127,4 @@ Promise.all([
assert.sameValue(results[4].value, 1);
assert.sameValue(results[5].value, 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -127,5 +127,5 @@ Promise.all([
assert.sameValue(results[4].value, 1);
assert.sameValue(results[5].value, 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -127,4 +127,4 @@ Promise.all([
assert.sameValue(results[4], 1);
assert.sameValue(results[5], 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -127,5 +127,5 @@ Promise.all([
assert.sameValue(results[4], 1);
assert.sameValue(results[5], 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -86,4 +86,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -81,4 +81,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -115,4 +115,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -71,4 +71,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -84,4 +84,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -55,4 +55,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -55,4 +55,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -55,4 +55,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -77,4 +77,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -93,4 +93,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -100,4 +100,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -134,4 +134,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -134,4 +134,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -133,4 +133,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -133,4 +133,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -133,4 +133,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -133,4 +133,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -115,4 +115,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -109,4 +109,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -109,4 +109,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -115,4 +115,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -137,8 +137,8 @@ C.m().next().then(function(v) {
assert.sameValue(results[4].value, 1);
assert.sameValue(results[5].value, 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -137,9 +137,9 @@ C.m().next().then(function(v) {
assert.sameValue(results[4].value, 1);
assert.sameValue(results[5].value, 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -137,8 +137,8 @@ C.m().next().then(function(v) {
assert.sameValue(results[4], 1);
assert.sameValue(results[5], 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -137,9 +137,9 @@ C.m().next().then(function(v) {
assert.sameValue(results[4], 1);
assert.sameValue(results[5], 1);
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -130,4 +130,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -131,4 +131,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -128,4 +128,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -128,4 +128,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -116,4 +116,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -116,4 +116,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -116,4 +116,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -110,4 +110,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -110,4 +110,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -110,4 +110,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -116,4 +116,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -77,4 +77,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -94,4 +94,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -81,4 +81,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -91,4 +91,4 @@ C.m().next().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -85,4 +85,4 @@ C.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -80,4 +80,4 @@ C.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -114,4 +114,4 @@ C.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -70,4 +70,4 @@ C.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -83,4 +83,4 @@ C.m().then(function(v) {
}
return Promise.resolve(assertions());
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

Some files were not shown because too many files have changed in this diff Show More