Index: src/preparser.cc |
diff --git a/src/preparser.cc b/src/preparser.cc |
index 04907d3c1cab9f3d378b347e47992a0717300a70..12cacd8d3124fa8e963fc97d2a139837ab94f319 100644 |
--- a/src/preparser.cc |
+++ b/src/preparser.cc |
@@ -97,17 +97,16 @@ PreParserExpression PreParserTraits::ParseV8Intrinsic(bool* ok) { |
PreParserExpression PreParserTraits::ParseFunctionLiteral( |
- PreParserIdentifier name, |
- Scanner::Location function_name_location, |
- bool name_is_strict_reserved, |
- bool is_generator, |
- int function_token_position, |
- FunctionLiteral::FunctionType type, |
- FunctionLiteral::ArityRestriction arity_restriction, |
- bool* ok) { |
+ PreParserIdentifier name, Scanner::Location function_name_location, |
+ bool name_is_strict_reserved, FunctionLiteral::IsGeneratorFlag is_generator, |
+ FunctionLiteral::IsArrowFlag is_arrow, |
+ FunctionLiteral::IsConciseMethodFlag is_concise_method, |
+ 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, is_generator, |
- function_token_position, type, arity_restriction, ok); |
+ is_arrow, is_concise_method, function_token_position, type, |
+ arity_restriction, ok); |
} |
@@ -335,14 +334,12 @@ 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, |
- is_generator, |
- pos, |
- FunctionLiteral::DECLARATION, |
- FunctionLiteral::NORMAL_ARITY, |
- CHECK_OK); |
+ ParseFunctionLiteral( |
+ name, scanner()->location(), is_strict_reserved, |
+ is_generator ? FunctionLiteral::kIsGenerator |
+ : FunctionLiteral::kNotGenerator, |
+ FunctionLiteral::kNotArrow, FunctionLiteral::kNotConciseMethod, pos, |
+ FunctionLiteral::DECLARATION, FunctionLiteral::NORMAL_ARITY, CHECK_OK); |
return Statement::FunctionDeclaration(); |
} |
@@ -800,14 +797,12 @@ PreParser::Statement PreParser::ParseDebuggerStatement(bool* ok) { |
PreParser::Expression PreParser::ParseFunctionLiteral( |
- Identifier function_name, |
- Scanner::Location function_name_location, |
- bool name_is_strict_reserved, |
- bool is_generator, |
- int function_token_pos, |
- FunctionLiteral::FunctionType function_type, |
- FunctionLiteral::ArityRestriction arity_restriction, |
- bool* ok) { |
+ Identifier function_name, Scanner::Location function_name_location, |
+ bool name_is_strict_reserved, FunctionLiteral::IsGeneratorFlag is_generator, |
+ FunctionLiteral::IsArrowFlag is_arrow, |
+ FunctionLiteral::IsConciseMethodFlag is_concise_method, |
+ int function_token_pos, FunctionLiteral::FunctionType function_type, |
+ FunctionLiteral::ArityRestriction arity_restriction, bool* ok) { |
// Function :: |
// '(' FormalParameterList? ')' '{' FunctionBody '}' |
@@ -871,7 +866,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral( |
// Validate strict mode. We can do this only after parsing the function, |
// since the function can declare itself strict. |
- if (strict_mode() == STRICT) { |
+ // Concise methods use StrictFormalParameters. |
+ if (strict_mode() == STRICT || is_concise_method) { |
if (function_name.IsEvalOrArguments()) { |
ReportMessageAt(function_name_location, "strict_eval_arguments"); |
*ok = false; |