Index: src/preparser.cc |
diff --git a/src/preparser.cc b/src/preparser.cc |
index 459cb6ae8a3bd00491ff90b75a88d8b12869650b..29b5c2fe41c5ca4071a85a4ef9a28e38f0527205 100644 |
--- a/src/preparser.cc |
+++ b/src/preparser.cc |
@@ -136,13 +136,14 @@ PreParserExpression PreParserTraits::ParseFunctionLiteral( |
PreParserIdentifier name, |
Scanner::Location function_name_location, |
bool name_is_strict_reserved, |
- bool is_generator, |
+ FunctionParsingMode parsing_mode, |
+ PreParserExpression params_ast, |
int function_token_position, |
FunctionLiteral::FunctionType type, |
bool* ok) { |
return pre_parser_->ParseFunctionLiteral( |
- name, function_name_location, name_is_strict_reserved, is_generator, |
- function_token_position, type, ok); |
+ name, function_name_location, name_is_strict_reserved, parsing_mode, |
+ params_ast, function_token_position, type, ok); |
} |
@@ -355,14 +356,17 @@ PreParser::Statement PreParser::ParseFunctionDeclaration(bool* ok) { |
// '{' FunctionBody '}' |
Expect(Token::FUNCTION, CHECK_OK); |
int pos = position(); |
- bool is_generator = allow_generators() && Check(Token::MUL); |
+ FunctionParsingMode parsing_mode = (allow_generators() && Check(Token::MUL)) |
+ ? kGeneratorFunction |
+ : kNormalFunction; |
bool is_strict_reserved = false; |
Identifier name = ParseIdentifierOrStrictReservedWord( |
&is_strict_reserved, CHECK_OK); |
ParseFunctionLiteral(name, |
scanner()->location(), |
is_strict_reserved, |
- is_generator, |
+ parsing_mode, |
+ EmptyExpression(), |
pos, |
FunctionLiteral::DECLARATION, |
CHECK_OK); |
@@ -841,7 +845,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral( |
Identifier function_name, |
Scanner::Location function_name_location, |
bool name_is_strict_reserved, |
- bool is_generator, |
+ FunctionParsingMode parsing_mode, |
+ PreParserExpression params_ast, |
int function_token_pos, |
FunctionLiteral::FunctionType function_type, |
bool* ok) { |
@@ -853,7 +858,7 @@ PreParser::Expression PreParser::ParseFunctionLiteral( |
bool inside_with = scope_->inside_with(); |
PreParserScope function_scope(scope_, FUNCTION_SCOPE); |
FunctionState function_state(&function_state_, &scope_, &function_scope); |
- function_state.set_is_generator(is_generator); |
+ function_state.set_is_generator(parsing_mode == kGeneratorFunction); |
// FormalParameterList :: |
// '(' (Identifier)*[','] ')' |
Expect(Token::LPAREN, CHECK_OK); |