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

Unified Diff: src/parsing/parser.cc

Issue 2123953002: [parser] Fix bug in destructuring binding for catch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 66241e1a11aae9e4b17adb3f467dae154aec602e..09cb40267864be51f2b87ff8f2d741eca7ba0310 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -3017,8 +3017,11 @@ TryStatement* Parser::ParseTryStatement(bool* ok) {
descriptor.declaration_pos = pattern->position();
descriptor.initialization_pos = pattern->position();
+ // Initializer position for variables declared by the pattern.
+ const int initializer_position = position();
+
DeclarationParsingResult::Declaration decl(
- pattern, pattern->position(),
+ pattern, initializer_position,
factory()->NewVariableProxy(catch_variable));
Block* init_block =

Powered by Google App Engine
This is Rietveld 408576698