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

Unified Diff: src/parsing/parser.cc

Issue 2225773003: Finalize scope via block-state in BuildParameterInitializationBlock (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | no next file » | 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 ff9d9fe7e2e50b581cf96c7a93aae3376c931fb8..f411f641f97403b662204373f26f9e9d1679372b 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -4770,16 +4770,14 @@ Block* Parser::BuildParameterInitializationBlock(
param_scope);
}
- {
- BlockState block_state(&scope_state_, param_scope);
- DeclarationParsingResult::Declaration decl(
- parameter.pattern, initializer_position, initial_value);
- PatternRewriter::DeclareAndInitializeVariables(param_block, &descriptor,
- &decl, nullptr, CHECK_OK);
- }
-
- if (!parameter.is_simple() && scope()->calls_sloppy_eval()) {
- param_scope = param_scope->FinalizeBlockScope();
+ BlockState block_state(&scope_state_, param_scope);
+ DeclarationParsingResult::Declaration decl(
+ parameter.pattern, initializer_position, initial_value);
+ PatternRewriter::DeclareAndInitializeVariables(param_block, &descriptor,
+ &decl, nullptr, CHECK_OK);
+
+ if (param_block != init_block) {
+ param_scope = block_state.FinalizedBlockScope();
if (param_scope != nullptr) {
CheckConflictingVarDeclarations(param_scope, CHECK_OK);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698