mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 23:44:27 +02:00
Use Promise chaining
Co-authored-by: Leo Balter <leonardo.balter@gmail.com>
This commit is contained in:
parent
bd6d417abc
commit
eabebb421d
@ -37,8 +37,8 @@ async function* asyncGenerator() {
|
|||||||
var asyncIterator = asyncGenerator();
|
var asyncIterator = asyncGenerator();
|
||||||
asyncIterator.next().then(function() {
|
asyncIterator.next().then(function() {
|
||||||
var promise = Promise.resolve(2).then(() => 3);
|
var promise = Promise.resolve(2).then(() => 3);
|
||||||
asyncIterator.return(promise).then(function(result) {
|
return asyncIterator.return(promise).then(function(result) {
|
||||||
assert.sameValue(result.value, 3);
|
assert.sameValue(result.value, 3);
|
||||||
assert.sameValue(result.done, true);
|
assert.sameValue(result.done, true);
|
||||||
}).then($DONE, $DONE);
|
});
|
||||||
}).catch($DONE);
|
}).then($DONE, $DONE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user