Commit b7e935c5 authored by Joshua Litt's avatar Joshua Litt Committed by Commit Bot

[parser] Fix async generator bytecode to only await on explicit return

Per ECMA-262 25.5.3.2, step 5.e: |generatorBody| execution ends with a normal completion.

Bug: v8:9050
Change-Id: If2ecc7d104e0b905a4b2b4695522be740e0d0349
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1611011Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Cr-Commit-Position: refs/heads/master@{#61589}
parent 15a7e04e
......@@ -1717,7 +1717,7 @@ void Parser::ParseAndRewriteAsyncGeneratorFunctionBody(
// try {
// InitialYield;
// ...body...;
// return undefined; // See comment below
// // fall through to the implicit return after the try-finally
// } catch (.catch) {
// %AsyncGeneratorReject(generator, .catch);
// } finally {
......@@ -1744,12 +1744,6 @@ void Parser::ParseAndRewriteAsyncGeneratorFunctionBody(
// Don't create iterator result for async generators, as the resume methods
// will create it.
// TODO(leszeks): This will create another suspend point, which is
// unnecessary if there is already an unconditional return in the body.
Statement* final_return = BuildReturnStatement(
factory()->NewUndefinedLiteral(kNoSourcePosition), kNoSourcePosition);
statements.Add(final_return);
try_block = factory()->NewBlock(false, statements);
}
......
......@@ -524,9 +524,6 @@
# https://bugs.chromium.org/p/v8/issues/detail?id=9049
'language/comments/hashbang/use-strict': [SKIP],
# https://bugs.chromium.org/p/v8/issues/detail?id=9050
'language/statements/async-generator/return-undefined-implicit-and-explicit': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=9228
'built-ins/Proxy/defineProperty/targetdesc-not-configurable-writable-desc-not-writable': [FAIL],
'built-ins/Proxy/deleteProperty/targetdesc-is-configurable-target-is-not-extensible': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment