Index: src/preparser.h |
diff --git a/src/preparser.h b/src/preparser.h |
index aeef700bfe7593a8369b4c4b5f0350fa8dc5b707..072ebca27cbacea94c730e070e792e7d17ee675a 100644 |
--- a/src/preparser.h |
+++ b/src/preparser.h |
@@ -881,7 +881,7 @@ class ParserBase : public Traits { |
ExpressionClassifier* classifier, bool* ok); |
void CheckArityRestrictions( |
int param_count, FunctionLiteral::ArityRestriction arity_restriction, |
- int formals_start_pos, int formals_end_pos, bool* ok); |
+ bool has_rest, int formals_start_pos, int formals_end_pos, bool* ok); |
// Checks if the expression is a valid reference expression (e.g., on the |
// left-hand side of assignments). Although ruled out by ECMA as early errors, |
@@ -3623,7 +3623,7 @@ int ParserBase<Traits>::ParseFormalParameterList( |
template <class Traits> |
void ParserBase<Traits>::CheckArityRestrictions( |
int param_count, FunctionLiteral::ArityRestriction arity_restriction, |
- int formals_start_pos, int formals_end_pos, bool* ok) { |
+ bool has_rest, int formals_start_pos, int formals_end_pos, bool* ok) { |
switch (arity_restriction) { |
case FunctionLiteral::GETTER_ARITY: |
if (param_count != 0) { |
@@ -3638,6 +3638,11 @@ void ParserBase<Traits>::CheckArityRestrictions( |
"bad_setter_arity"); |
*ok = false; |
} |
+ if (has_rest) { |
+ ReportMessageAt(Scanner::Location(formals_start_pos, formals_end_pos), |
+ "setter_rest_param"); |
+ *ok = false; |
+ } |
break; |
default: |
break; |