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

Unified Diff: src/parsing/parser.cc

Issue 2390943002: Don't skip hole checks inside patterns in parameter lists (Closed)
Patch Set: Created 4 years, 2 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 | test/mjsunit/regress/regress-5454.js » ('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 2cf97bc14b539ee965d16b76ec7a9e2d80205d9b..0ae1fb619a70ff1aa8bf224fa5a613ec99ebcea4 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -2939,9 +2939,6 @@ Block* Parser::BuildParameterInitializationBlock(
// TODO(adamk): Should this be kNoSourcePosition, since
// it's just copying from a temp var to the real param var?
descriptor.initialization_pos = parameter.pattern->position();
- // The initializer position which will end up in,
- // Variable::initializer_position(), used for hole check elimination.
- int initializer_position = parameter.pattern->position();
Expression* initial_value =
factory()->NewVariableProxy(parameters.scope->parameter(i));
if (parameter.initializer != nullptr) {
@@ -2957,7 +2954,6 @@ Block* Parser::BuildParameterInitializationBlock(
initial_value = factory()->NewConditional(
condition, parameter.initializer, initial_value, kNoSourcePosition);
descriptor.initialization_pos = parameter.initializer->position();
- initializer_position = parameter.initializer_end_position;
}
Scope* param_scope = scope();
@@ -2980,7 +2976,7 @@ Block* Parser::BuildParameterInitializationBlock(
BlockState block_state(&scope_state_, param_scope);
DeclarationParsingResult::Declaration decl(
- parameter.pattern, initializer_position, initial_value);
+ parameter.pattern, parameter.initializer_end_position, initial_value);
PatternRewriter::DeclareAndInitializeVariables(
this, param_block, &descriptor, &decl, nullptr, CHECK_OK);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5454.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698