Chromium Code Reviews| Index: src/parser.cc |
| diff --git a/src/parser.cc b/src/parser.cc |
| index 5f794c23c999a740ad1e0f0c9bb2c60286bf8a6e..d3b3e24140f26f2b2669ecff97b1f7332f5e70a5 100644 |
| --- a/src/parser.cc |
| +++ b/src/parser.cc |
| @@ -519,6 +519,7 @@ void ParserTraits::CheckPossibleEvalCall(Expression* expression, |
| if (callee != NULL && |
| callee->raw_name() == parser_->ast_value_factory()->eval_string()) { |
| scope->DeclarationScope()->RecordEvalCall(); |
| + scope->RecordEvalCall(); |
|
rossberg
2015/04/17 15:16:27
Hm, why is this needed?
Dmitry Lomov (no reviews)
2015/04/17 15:21:54
I need to record eval inside block scopes.
rossberg
2015/04/17 15:26:07
Right, I keep forgetting that "declaration scope"
|
| } |
| } |
| @@ -3299,8 +3300,8 @@ Statement* Parser::DesugarLexicalBindingsInForStatement( |
| clear_first = |
| factory()->NewExpressionStatement(assignment, RelocInfo::kNoPosition); |
| } |
| - Statement* clear_first_or_next = |
| - factory()->NewIfStatement(compare, clear_first, next, next->position()); |
| + Statement* clear_first_or_next = factory()->NewIfStatement( |
| + compare, clear_first, next, RelocInfo::kNoPosition); |
| inner_block->AddStatement(clear_first_or_next, zone()); |
| } |
| @@ -4055,6 +4056,10 @@ FunctionLiteral* Parser::ParseFunctionLiteral( |
| parenthesized_function_ = false; // The bit was set for this function only. |
| if (is_lazily_parsed) { |
| + for (Scope* s = scope_->outer_scope(); |
| + s != nullptr && s->is_block_scope(); s = s->outer_scope()) { |
|
rossberg
2015/04/17 15:16:27
I think you have to walk up all the way to the nex
Dmitry Lomov (no reviews)
2015/04/20 11:53:20
Done.
|
| + s->ForceContextAllocation(); |
| + } |
| SkipLazyFunctionBody(function_name, &materialized_literal_count, |
| &expected_property_count, CHECK_OK); |
| } else { |