mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 14:35:30 +02:00
Fixup incorrect assertion in AsyncGenerator.p.return with broken promises
This commit is contained in:
parent
bd472562c8
commit
9b127c190c
@ -46,17 +46,21 @@ Object.defineProperty(brokenPromise, 'constructor', {
|
||||
}
|
||||
});
|
||||
|
||||
it.next();
|
||||
it.return(brokenPromise)
|
||||
.then(
|
||||
() => {
|
||||
throw new Test262Error("Expected rejection");
|
||||
},
|
||||
err => {
|
||||
assert(unblocked, false, 'return should be rejected before generator is resumed');
|
||||
assert.sameValue(err.message, 'broken promise');
|
||||
}
|
||||
)
|
||||
.then($DONE, $DONE);
|
||||
it.next().then(function(result) {
|
||||
assert.sameValue(result.value, undefined);
|
||||
assert.sameValue(result.done, true);
|
||||
|
||||
it.return(brokenPromise)
|
||||
.then(
|
||||
() => {
|
||||
throw new Test262Error("Expected rejection");
|
||||
},
|
||||
err => {
|
||||
assert(unblocked, 'return should be rejected when the generator is completed');
|
||||
assert.sameValue(err.message, 'broken promise');
|
||||
}
|
||||
)
|
||||
.then($DONE, $DONE);
|
||||
});
|
||||
|
||||
unblock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user