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

Unified Diff: src/parsing/parser.cc

Issue 1767063002: Fix completion value of empty catch block in the presence of destructuring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 9 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
« no previous file with comments | « no previous file | src/parsing/pattern-rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 40b4decb7203441d32fddcb5ee335824aafae4e4..caf0f868fdb396e269e646717211af563e5fcec9 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -3101,8 +3101,11 @@ TryStatement* Parser::ParseTryStatement(bool* ok) {
pattern, pattern->position(),
factory()->NewVariableProxy(catch_variable));
+ Block* init_block =
+ factory()->NewBlock(nullptr, 8, true, RelocInfo::kNoPosition);
PatternRewriter::DeclareAndInitializeVariables(
- catch_block, &descriptor, &decl, nullptr, CHECK_OK);
+ init_block, &descriptor, &decl, nullptr, CHECK_OK);
+ catch_block->statements()->Add(init_block, zone());
}
Expect(Token::LBRACE, CHECK_OK);
« no previous file with comments | « no previous file | src/parsing/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698