Index: src/parser.h |
diff --git a/src/parser.h b/src/parser.h |
index 0d663b84e6206d516d851b9d7fd85b98cefa2763..d092403e7af1fb01e3298d6b53bcaa1c9b4090d9 100644 |
--- a/src/parser.h |
+++ b/src/parser.h |
@@ -754,19 +754,9 @@ class ParserTraits { |
V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type, |
FunctionKind kind = kNormalFunction); |
- bool DeclareFormalParameter(Scope* scope, const AstRawString* name, |
- bool is_rest) { |
- bool is_duplicate = false; |
- Variable* var = scope->DeclareParameter(name, VAR, is_rest, &is_duplicate); |
- if (is_sloppy(scope->language_mode())) { |
- // TODO(sigurds) Mark every parameter as maybe assigned. This is a |
- // conservative approximation necessary to account for parameters |
- // that are assigned via the arguments array. |
- var->set_maybe_assigned(); |
- } |
- return is_duplicate; |
- } |
- |
+ V8_INLINE void DeclareFormalParameter(Scope* scope, const AstRawString* name, |
+ ExpressionClassifier* classifier, |
+ bool is_rest); |
void DeclareArrowFunctionParameters(Scope* scope, Expression* expr, |
const Scanner::Location& params_loc, |
Scanner::Location* duplicate_loc, |
@@ -1282,6 +1272,25 @@ Expression* ParserTraits::SpreadCallNew( |
Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { |
return parser_->SpreadCallNew(function, args, pos); |
} |
+ |
+ |
+void ParserTraits::DeclareFormalParameter(Scope* scope, |
+ const AstRawString* name, |
+ ExpressionClassifier* classifier, |
+ bool is_rest) { |
+ bool is_duplicate = false; |
+ Variable* var = scope->DeclareParameter(name, VAR, is_rest, &is_duplicate); |
+ if (is_sloppy(scope->language_mode())) { |
+ // TODO(sigurds) Mark every parameter as maybe assigned. This is a |
+ // conservative approximation necessary to account for parameters |
+ // that are assigned via the arguments array. |
+ var->set_maybe_assigned(); |
+ } |
+ if (is_duplicate) { |
+ classifier->RecordDuplicateFormalParameterError( |
+ parser_->scanner()->location()); |
+ } |
+} |
} } // namespace v8::internal |
#endif // V8_PARSER_H_ |