Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: src/parsing/parser.cc

Issue 2276243002: Mark await expressions as caught or uncaught (Closed)
Patch Set: Format Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 119c0164edd87b40de9b1c1742b78556d3bb8eec..5e0b16aaff0181f44212041d0122eb9f0c492a65 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -3884,8 +3884,10 @@ Block* Parser::BuildRejectPromiseOnException(Block* inner_block, bool* ok) {
factory()->NewReturnStatement(promise_reject, kNoSourcePosition);
catch_block->statements()->Add(return_promise_reject, zone());
- TryStatement* try_catch_statement = factory()->NewTryCatchStatement(
- inner_block, catch_scope, catch_variable, catch_block, kNoSourcePosition);
+ TryStatement* try_catch_statement =
+ factory()->NewTryCatchStatementForAsyncAwait(inner_block, catch_scope,
+ catch_variable, catch_block,
+ kNoSourcePosition);
// There is no TryCatchFinally node, so wrap it in an outer try/finally
Block* outer_try_block =
@@ -4884,8 +4886,9 @@ Expression* Parser::RewriteAwaitExpression(Expression* value, int await_pos) {
factory()->NewVariableProxy(generator_object_variable);
async_function_await_args->Add(generator_object, zone());
async_function_await_args->Add(temp_proxy, zone());
- Expression* async_function_await = factory()->NewCallRuntime(
- Context::ASYNC_FUNCTION_AWAIT_INDEX, async_function_await_args, nopos);
+ Expression* async_function_await =
+ factory()->NewCallRuntime(Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX,
+ async_function_await_args, nopos);
// Wrap await to provide a break location between value evaluation and yield.
Expression* await_assignment = factory()->NewAssignment(
Token::ASSIGN, temp_proxy, async_function_await, nopos);

Powered by Google App Engine
This is Rietveld 408576698