mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 23:14:47 +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.next().then(function(result) {
|
||||||
it.return(brokenPromise)
|
assert.sameValue(result.value, undefined);
|
||||||
.then(
|
assert.sameValue(result.done, true);
|
||||||
() => {
|
|
||||||
throw new Test262Error("Expected rejection");
|
it.return(brokenPromise)
|
||||||
},
|
.then(
|
||||||
err => {
|
() => {
|
||||||
assert(unblocked, false, 'return should be rejected before generator is resumed');
|
throw new Test262Error("Expected rejection");
|
||||||
assert.sameValue(err.message, 'broken promise');
|
},
|
||||||
}
|
err => {
|
||||||
)
|
assert(unblocked, 'return should be rejected when the generator is completed');
|
||||||
.then($DONE, $DONE);
|
assert.sameValue(err.message, 'broken promise');
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then($DONE, $DONE);
|
||||||
|
});
|
||||||
|
|
||||||
unblock();
|
unblock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user