diff options
Diffstat (limited to 'test/language/expressions/async-generator/throw-suspendedYield-try-catch.js')
-rw-r--r-- | test/language/expressions/async-generator/throw-suspendedYield-try-catch.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/language/expressions/async-generator/throw-suspendedYield-try-catch.js b/test/language/expressions/async-generator/throw-suspendedYield-try-catch.js index 5806017fc..dad975f7a 100644 --- a/test/language/expressions/async-generator/throw-suspendedYield-try-catch.js +++ b/test/language/expressions/async-generator/throw-suspendedYield-try-catch.js @@ -3,11 +3,22 @@ /*--- author: Caitlin Potter <caitp@igalia.com> -esid: pending +esid: sec-asyncgenerator-prototype-throw description: > Thrown generator suspended in a yield position resumes execution within the associated catch-block info: | + AsyncGenerator.prototype.throw ( exception ) + 1. Let generator be the this value. + 2. Let completion be Completion{[[Type]]: throw, [[Value]]: exception, [[Target]]: empty}. + 3. Return ! AsyncGeneratorEnqueue(generator, completion). + + AsyncGeneratorEnqueue ( generator, completion ) + ... + 8. If state is not "executing", then + a. Perform ! AsyncGeneratorResumeNext(generator). + ... + AsyncGeneratorResumeNext: If completion.[[Type]] is throw, and generator.[[AsyncGeneratorState]] is "suspendedYield", and generator is resumed within a try-block with an @@ -40,7 +51,7 @@ it.next().then(function(ret) { assert.sameValue(ret.value, undefined, 'Generator is closed'); assert.sameValue(ret.done, true, 'Generator is closed'); }).then($DONE, $DONE); - + }).catch($DONE); }).catch($DONE); |