| Index: src/parsing/parser.cc
|
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
|
| index 16c6b36ab41186307ae09cb3ccd27e0121c8f65a..b46d03171aed81b51b2ae7cf379e3905787f8d7a 100644
|
| --- a/src/parsing/parser.cc
|
| +++ b/src/parsing/parser.cc
|
| @@ -923,9 +923,12 @@ FunctionLiteral* Parser::DoParseLazy(ParseInfo* info,
|
| {
|
| // Parse the function literal.
|
| Scope* outer = original_scope_;
|
| + DeclarationScope* outer_function = outer->GetClosureScope();
|
| DCHECK(outer);
|
| - FunctionState function_state(&function_state_, &scope_state_, outer,
|
| - info->function_kind());
|
| + FunctionState function_state(&function_state_, &scope_state_,
|
| + outer_function,
|
| + outer_function->function_kind());
|
| + BlockState block_state(&scope_state_, outer);
|
| DCHECK(is_sloppy(outer->language_mode()) ||
|
| is_strict(info->language_mode()));
|
| FunctionLiteral::FunctionType function_type = ComputeFunctionType(info);
|
| @@ -2926,7 +2929,7 @@ Parser::LazyParsingResult Parser::SkipLazyFunctionBody(
|
| if (produce_cached_parse_data()) CHECK(log_);
|
|
|
| int function_block_pos = position();
|
| - DeclarationScope* scope = this->scope()->AsDeclarationScope();
|
| + DeclarationScope* scope = function_state_->scope();
|
| DCHECK(scope->is_function_scope());
|
| scope->set_is_lazily_parsed(true);
|
| if (consume_cached_parse_data() && !cached_parse_data_->rejected()) {
|
| @@ -2957,6 +2960,7 @@ Parser::LazyParsingResult Parser::SkipLazyFunctionBody(
|
| SingletonLogger logger;
|
| PreParser::PreParseResult result =
|
| ParseLazyFunctionBodyWithPreParser(&logger, may_abort);
|
| +
|
| // Return immediately if pre-parser decided to abort parsing.
|
| if (result == PreParser::kPreParseAbort) {
|
| scope->set_is_lazily_parsed(false);
|
| @@ -3453,9 +3457,8 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
|
| #undef SET_ALLOW
|
| }
|
| PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction(
|
| - language_mode(), function_state_->kind(),
|
| - scope()->AsDeclarationScope()->has_simple_parameters(), parsing_module_,
|
| - logger, may_abort, use_counts_);
|
| + function_state_->scope(), parsing_module_, logger, may_abort,
|
| + use_counts_);
|
| if (pre_parse_timer_ != NULL) {
|
| pre_parse_timer_->Stop();
|
| }
|
|
|