| Index: src/preparser.cc
|
| diff --git a/src/preparser.cc b/src/preparser.cc
|
| index abf28c1ddf517e815908450ba59e69281ad86599..c7a19bc0baad0622c6ccccfb584451b3e07ad16b 100644
|
| --- a/src/preparser.cc
|
| +++ b/src/preparser.cc
|
| @@ -91,11 +91,11 @@ PreParserExpression PreParserTraits::ParseV8Intrinsic(bool* ok) {
|
|
|
| PreParserExpression PreParserTraits::ParseFunctionLiteral(
|
| PreParserIdentifier name, Scanner::Location function_name_location,
|
| - bool name_is_strict_reserved, FunctionKind kind,
|
| + FunctionNameValidity function_name_validity, FunctionKind kind,
|
| int function_token_position, FunctionLiteral::FunctionType type,
|
| FunctionLiteral::ArityRestriction arity_restriction, bool* ok) {
|
| return pre_parser_->ParseFunctionLiteral(
|
| - name, function_name_location, name_is_strict_reserved, kind,
|
| + name, function_name_location, function_name_validity, kind,
|
| function_token_position, type, arity_restriction, ok);
|
| }
|
|
|
| @@ -419,7 +419,9 @@ PreParser::Statement PreParser::ParseFunctionDeclaration(bool* ok) {
|
| bool is_strict_reserved = false;
|
| Identifier name = ParseIdentifierOrStrictReservedWord(
|
| &is_strict_reserved, CHECK_OK);
|
| - ParseFunctionLiteral(name, scanner()->location(), is_strict_reserved,
|
| + ParseFunctionLiteral(name, scanner()->location(),
|
| + is_strict_reserved ? kFunctionNameIsStrictReserved
|
| + : kFunctionNameValidityUnknown,
|
| is_generator ? FunctionKind::kGeneratorFunction
|
| : FunctionKind::kNormalFunction,
|
| pos, FunctionLiteral::DECLARATION,
|
| @@ -1028,8 +1030,8 @@ PreParser::Statement PreParser::ParseDebuggerStatement(bool* ok) {
|
|
|
| PreParser::Expression PreParser::ParseFunctionLiteral(
|
| Identifier function_name, Scanner::Location function_name_location,
|
| - bool name_is_strict_reserved, FunctionKind kind, int function_token_pos,
|
| - FunctionLiteral::FunctionType function_type,
|
| + FunctionNameValidity function_name_validity, FunctionKind kind,
|
| + int function_token_pos, FunctionLiteral::FunctionType function_type,
|
| FunctionLiteral::ArityRestriction arity_restriction, bool* ok) {
|
| // Function ::
|
| // '(' FormalParameterList? ')' '{' FunctionBody '}'
|
| @@ -1072,8 +1074,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
|
|
|
| // Validate name and parameter names. We can do this only after parsing the
|
| // function, since the function can declare itself strict.
|
| - CheckFunctionName(language_mode(), kind, function_name,
|
| - name_is_strict_reserved, function_name_location, CHECK_OK);
|
| + CheckFunctionName(language_mode(), function_name, function_name_validity,
|
| + function_name_location, CHECK_OK);
|
| const bool strict_formal_parameters =
|
| !parsing_state.is_simple_parameter_list || IsConciseMethod(kind);
|
| const bool allow_duplicate_parameters =
|
|
|