Chromium Code Reviews| Index: src/parsing/parser.cc |
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
| index e8c86427953994df18bb1608c51afd44537c7170..5a55eb79b9e5a6c8eed0c809bc34af51c7df4371 100644 |
| --- a/src/parsing/parser.cc |
| +++ b/src/parsing/parser.cc |
| @@ -3435,6 +3435,7 @@ Statement* Parser::ParseScopedStatement(ZoneList<const AstRawString*>* labels, |
| // Make a block around the statement for a lexical binding |
| // is introduced by a FunctionDeclaration. |
| Scope* body_scope = NewScope(scope_, BLOCK_SCOPE); |
| + body_scope->set_start_position(scanner()->location().beg_pos); |
| BlockState block_state(&scope_, body_scope); |
| Block* block = factory()->NewBlock(NULL, 1, false, RelocInfo::kNoPosition); |
| Statement* body = ParseFunctionDeclaration(NULL, CHECK_OK); |
| @@ -3459,6 +3460,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels, |
| Expect(Token::FOR, CHECK_OK); |
| Expect(Token::LPAREN, CHECK_OK); |
| for_scope->set_start_position(scanner()->location().beg_pos); |
| + for_scope->set_is_hidden(); |
| DeclarationParsingResult parsing_result; |
| if (peek() != Token::SEMICOLON) { |
| if (peek() == Token::VAR || peek() == Token::CONST || |
| @@ -4387,6 +4389,7 @@ Block* Parser::BuildParameterInitializationBlock( |
| param_scope->set_is_declaration_scope(); |
| param_scope->set_start_position(parameter.pattern->position()); |
| param_scope->set_end_position(RelocInfo::kNoPosition); |
| + param_scope->set_is_hidden(); |
|
adamk
2016/04/21 19:59:20
Should this scope really be hidden? Could you add
|
| param_scope->RecordEvalCall(); |
| param_block = factory()->NewBlock(NULL, 8, true, RelocInfo::kNoPosition); |
| param_block->set_scope(param_scope); |
| @@ -5975,6 +5978,7 @@ Expression* ParserTraits::RewriteYieldStar( |
| catch_block->statements()->Add(set_mode_throw, zone); |
| Scope* catch_scope = NewScope(scope, CATCH_SCOPE); |
| + catch_scope->set_is_hidden(); |
| const AstRawString* name = avfactory->dot_catch_string(); |
| Variable* catch_variable = |
| catch_scope->DeclareLocal(name, VAR, kCreatedInitialized, |
| @@ -6456,6 +6460,7 @@ void ParserTraits::FinalizeIteratorUse(Variable* completion, |
| Variable* catch_variable = |
| catch_scope->DeclareLocal(avfactory->dot_catch_string(), VAR, |
| kCreatedInitialized, Variable::NORMAL); |
| + catch_scope->set_is_hidden(); |
| Statement* rethrow; |
| // We use %ReThrow rather than the ordinary throw because we want to |
| @@ -6567,6 +6572,7 @@ void ParserTraits::BuildIteratorCloseForCompletion( |
| Variable* catch_variable = catch_scope->DeclareLocal( |
| avfactory->dot_catch_string(), VAR, kCreatedInitialized, |
| Variable::NORMAL); |
| + catch_scope->set_is_hidden(); |
| try_call_return = factory->NewTryCatchStatement( |
| try_block, catch_scope, catch_variable, catch_block, nopos); |