Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 8164c7d3b2cda7e9dd5af74dac0883f0ff95541e..50d875feb687347ca72b2f163f3ae84750105911 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -4554,7 +4554,6 @@ |
DCHECK(scope_->is_function_scope()); |
Block* init_block = |
factory()->NewBlock(NULL, 1, true, RelocInfo::kNoPosition); |
- ZoneList<Scope*>* param_scopes = new (zone()) ZoneList<Scope*>(0, zone()); |
for (int i = 0; i < parameters.params.length(); ++i) { |
auto parameter = parameters.params[i]; |
if (parameter.is_rest && parameter.pattern->IsVariableProxy()) break; |
@@ -4596,13 +4595,12 @@ |
Scope* param_scope = scope_; |
Block* param_block = init_block; |
- if (!parameter.is_simple()) { |
+ if (!parameter.is_simple() && scope_->calls_sloppy_eval()) { |
param_scope = NewScope(scope_, BLOCK_SCOPE); |
param_scope->set_is_declaration_scope(); |
param_scope->set_start_position(descriptor.initialization_pos); |
param_scope->set_end_position(parameter.initializer_end_position); |
- param_scopes->Add(param_scope, zone()); |
- scope_->PropagateUsageFlagsToScope(param_scope); |
+ param_scope->RecordEvalCall(); |
param_block = factory()->NewBlock(NULL, 8, true, RelocInfo::kNoPosition); |
param_block->set_scope(param_scope); |
descriptor.hoist_scope = scope_; |
@@ -4616,16 +4614,13 @@ |
&decl, nullptr, CHECK_OK); |
} |
- if (!parameter.is_simple()) { |
+ if (!parameter.is_simple() && scope_->calls_sloppy_eval()) { |
param_scope = param_scope->FinalizeBlockScope(); |
if (param_scope != nullptr) { |
CheckConflictingVarDeclarations(param_scope, CHECK_OK); |
} |
init_block->statements()->Add(param_block, zone()); |
} |
- } |
- for (Scope* param_scope : *param_scopes) { |
- scope_->PropagateUsageFlagsToScope(param_scope); |
} |
return init_block; |
} |