| Index: src/parsing/parser-base.h
|
| diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
|
| index c51cdce51ae1e1dd69e9b98420ffefacb3316753..a3854d18c3f311b3a7a31e6b0f0cfa18e79c8b81 100644
|
| --- a/src/parsing/parser-base.h
|
| +++ b/src/parsing/parser-base.h
|
| @@ -802,9 +802,10 @@ class ParserBase : public Traits {
|
| ExpressionClassifier* classifier, bool* ok);
|
| void ParseFormalParameterList(FormalParametersT* parameters,
|
| ExpressionClassifier* classifier, bool* ok);
|
| - void CheckArityRestrictions(
|
| - int param_count, FunctionLiteral::ArityRestriction arity_restriction,
|
| - bool has_rest, int formals_start_pos, int formals_end_pos, bool* ok);
|
| + void CheckArityRestrictions(int param_count,
|
| + FunctionLiteral::FunctionType function_type,
|
| + bool has_rest, int formals_start_pos,
|
| + int formals_end_pos, bool* ok);
|
|
|
| bool IsNextLetKeyword();
|
|
|
| @@ -1737,8 +1738,7 @@ ParserBase<Traits>::ParsePropertyDefinition(
|
|
|
| value = this->ParseFunctionLiteral(
|
| *name, scanner()->location(), kSkipFunctionNameCheck, kind,
|
| - RelocInfo::kNoPosition, FunctionLiteral::kAnonymousExpression,
|
| - FunctionLiteral::kNormalArity, language_mode(),
|
| + RelocInfo::kNoPosition, FunctionLiteral::kMethod, language_mode(),
|
| CHECK_OK_CUSTOM(EmptyObjectLiteralProperty));
|
|
|
| return factory()->NewObjectLiteralProperty(name_expression, value,
|
| @@ -1779,8 +1779,7 @@ ParserBase<Traits>::ParsePropertyDefinition(
|
| typename Traits::Type::FunctionLiteral value = this->ParseFunctionLiteral(
|
| *name, scanner()->location(), kSkipFunctionNameCheck,
|
| FunctionKind::kAccessorFunction, RelocInfo::kNoPosition,
|
| - FunctionLiteral::kAnonymousExpression,
|
| - is_get ? FunctionLiteral::kGetterArity : FunctionLiteral::kSetterArity,
|
| + is_get ? FunctionLiteral::kGetter : FunctionLiteral::kSetter,
|
| language_mode(), CHECK_OK_CUSTOM(EmptyObjectLiteralProperty));
|
|
|
| // Make sure the name expression is a string since we need a Name for
|
| @@ -2577,8 +2576,7 @@ ParserBase<Traits>::ParseMemberExpression(ExpressionClassifier* classifier,
|
| : kFunctionNameValidityUnknown,
|
| is_generator ? FunctionKind::kGeneratorFunction
|
| : FunctionKind::kNormalFunction,
|
| - function_token_position, function_type, FunctionLiteral::kNormalArity,
|
| - language_mode(), CHECK_OK);
|
| + function_token_position, function_type, language_mode(), CHECK_OK);
|
| } else if (peek() == Token::SUPER) {
|
| const bool is_new = false;
|
| result = ParseSuperExpression(is_new, classifier, CHECK_OK);
|
| @@ -2970,20 +2968,19 @@ void ParserBase<Traits>::ParseFormalParameterList(
|
| }
|
| }
|
|
|
| -
|
| template <class Traits>
|
| void ParserBase<Traits>::CheckArityRestrictions(
|
| - int param_count, FunctionLiteral::ArityRestriction arity_restriction,
|
| - bool has_rest, int formals_start_pos, int formals_end_pos, bool* ok) {
|
| - switch (arity_restriction) {
|
| - case FunctionLiteral::kGetterArity:
|
| + int param_count, FunctionLiteral::FunctionType function_type, bool has_rest,
|
| + int formals_start_pos, int formals_end_pos, bool* ok) {
|
| + switch (function_type) {
|
| + case FunctionLiteral::kGetter:
|
| if (param_count != 0) {
|
| ReportMessageAt(Scanner::Location(formals_start_pos, formals_end_pos),
|
| MessageTemplate::kBadGetterArity);
|
| *ok = false;
|
| }
|
| break;
|
| - case FunctionLiteral::kSetterArity:
|
| + case FunctionLiteral::kSetter:
|
| if (param_count != 1) {
|
| ReportMessageAt(Scanner::Location(formals_start_pos, formals_end_pos),
|
| MessageTemplate::kBadSetterArity);
|
|
|