diff options
Diffstat (limited to 'deps/v8/src/parsing/preparser.cc')
-rw-r--r-- | deps/v8/src/parsing/preparser.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/deps/v8/src/parsing/preparser.cc b/deps/v8/src/parsing/preparser.cc index 464e8e7b17c..f9af109d817 100644 --- a/deps/v8/src/parsing/preparser.cc +++ b/deps/v8/src/parsing/preparser.cc @@ -78,7 +78,7 @@ PreParser::PreParseResult PreParser::PreParseProgram() { // ModuleDeclarationInstantiation for Source Text Module Records creates a // new Module Environment Record whose outer lexical environment record is // the global scope. - if (parsing_module_) scope = NewModuleScope(scope); + if (flags().is_module()) scope = NewModuleScope(scope); FunctionState top_scope(&function_state_, &scope_, scope); original_scope_ = scope_; @@ -105,11 +105,9 @@ void PreParserFormalParameters::ValidateStrictMode(PreParser* preparser) const { PreParser::PreParseResult PreParser::PreParseFunction( const AstRawString* function_name, FunctionKind kind, FunctionSyntaxKind function_syntax_kind, DeclarationScope* function_scope, - int* use_counts, ProducedPreparseData** produced_preparse_data, - int script_id) { + int* use_counts, ProducedPreparseData** produced_preparse_data) { DCHECK_EQ(FUNCTION_SCOPE, function_scope->scope_type()); use_counts_ = use_counts; - set_script_id(script_id); #ifdef DEBUG function_scope->set_is_being_lazily_parsed(true); #endif @@ -268,6 +266,7 @@ PreParser::Expression PreParser::ParseFunctionLiteral( int function_token_pos, FunctionSyntaxKind function_syntax_kind, LanguageMode language_mode, ZonePtrList<const AstRawString>* arguments_for_wrapped_function) { + FunctionParsingScope function_parsing_scope(this); // Wrapped functions are not parsed in the preparser. DCHECK_NULL(arguments_for_wrapped_function); DCHECK_NE(FunctionSyntaxKind::kWrapped, function_syntax_kind); @@ -358,7 +357,7 @@ PreParser::Expression PreParser::ParseFunctionLiteral( name_byte_length = string->byte_length(); } logger_->FunctionEvent( - event_name, script_id(), ms, function_scope->start_position(), + event_name, flags().script_id(), ms, function_scope->start_position(), function_scope->end_position(), name, name_byte_length); } |