mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 23:14:47 +02:00
Use $DONE instead of $ERROR to avoid unhandled rejections
This commit is contained in:
parent
739c4cd78d
commit
c472aeea4b
@ -36,5 +36,4 @@ yes.then(function(x) {
|
|||||||
}).then(function() {
|
}).then(function() {
|
||||||
assert.sameValue(sequence.length, 5);
|
assert.sameValue(sequence.length, 5);
|
||||||
checkSequence(sequence, "All expected callbacks called in correct order");
|
checkSequence(sequence, "All expected callbacks called in correct order");
|
||||||
$DONE();
|
}).then($DONE, $DONE);
|
||||||
}).catch($ERROR);
|
|
||||||
|
@ -20,6 +20,5 @@ class FooPromise extends Promise {
|
|||||||
new FooPromise(r => r())
|
new FooPromise(r => r())
|
||||||
.finally(() => {})
|
.finally(() => {})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
assert.sameValue(count, 6, "6 new promises were created");
|
assert.sameValue(count, 7, "7 new promises were created");
|
||||||
$DONE();
|
}).then($DONE, $DONE);
|
||||||
}, $ERROR);
|
|
||||||
|
@ -16,7 +16,8 @@ class FooPromise extends Promise {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FooPromise.reject().finally(() => {}).then($ERROR).catch(() => {
|
FooPromise.reject().finally(() => {}).then(value => {
|
||||||
assert.sameValue(7, count);
|
throw new Test262Error("Expected Promise to be rejected, got: resolved with " + value);
|
||||||
$DONE();
|
}, () => {
|
||||||
});
|
assert.sameValue(count, 7);
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
@ -17,6 +17,5 @@ class FooPromise extends Promise {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FooPromise.resolve().finally(() => {}).then(() => {
|
FooPromise.resolve().finally(() => {}).then(() => {
|
||||||
assert.sameValue(6, count);
|
assert.sameValue(count, 7);
|
||||||
$DONE();
|
}).then($DONE, $DONE);
|
||||||
}, $ERROR);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user