Use Promise chaining

Co-authored-by: Leo Balter <leonardo.balter@gmail.com>
This commit is contained in:
Alexey Shvayka 2020-05-27 22:28:10 +03:00
parent bd6d417abc
commit eabebb421d
1 changed files with 3 additions and 3 deletions

View File

@ -37,8 +37,8 @@ async function* asyncGenerator() {
var asyncIterator = asyncGenerator();
asyncIterator.next().then(function() {
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.done, true);
}).then($DONE, $DONE);
}).catch($DONE);
});
}).then($DONE, $DONE);