| Index: src/parsing/parser.cc
|
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
|
| index 073800d8167d4583c3091880555cb5b474ed11c6..279641c3a916427ccc26309f873193e33732f4b7 100644
|
| --- a/src/parsing/parser.cc
|
| +++ b/src/parsing/parser.cc
|
| @@ -854,7 +854,12 @@ FunctionLiteral* Parser::ParseFunction(Isolate* isolate, ParseInfo* info) {
|
| timer.Start();
|
| }
|
| Handle<SharedFunctionInfo> shared_info = info->shared_info();
|
| - DeserializeScopeChain(info, info->maybe_outer_scope_info());
|
| + if (!info->script_scope()) {
|
| + DeserializeScopeChain(info, info->maybe_outer_scope_info());
|
| + } else {
|
| + original_scope_ = new (info->zone()) DeclarationScope(
|
| + info->zone(), info->script_scope()->outer_scope(), FUNCTION_SCOPE);
|
| + }
|
|
|
| // Initialize parser state.
|
| source = String::Flatten(source);
|
| @@ -2610,8 +2615,6 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
|
| // FunctionExpression; even without enclosing parentheses it might be
|
| // immediately invoked.
|
| // - The function literal shouldn't be hinted to eagerly compile.
|
| - // - For asm.js functions the body needs to be available when module
|
| - // validation is active, because we examine the entire module at once.
|
|
|
| // Inner functions will be parsed using a temporary Zone. After parsing, we
|
| // will migrate unresolved variable into a Scope in the main Zone.
|
| @@ -2621,8 +2624,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
|
| ? can_preparse
|
| : (is_lazy_top_level_function ||
|
| (allow_lazy_ && function_type == FunctionLiteral::kDeclaration &&
|
| - eager_compile_hint == FunctionLiteral::kShouldLazyCompile))) &&
|
| - !(FLAG_validate_asm && scope()->IsAsmModule());
|
| + eager_compile_hint == FunctionLiteral::kShouldLazyCompile)));
|
| bool is_lazy_inner_function =
|
| use_temp_zone && FLAG_lazy_inner_functions && !is_lazy_top_level_function;
|
|
|
|
|