Follow-up to r19112.
authormarja@chromium.org <marja@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 6 Feb 2014 10:16:25 +0000 (10:16 +0000)
committermarja@chromium.org <marja@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 6 Feb 2014 10:16:25 +0000 (10:16 +0000)
There's only one error message for "eval" and "arguments", so no need to pass it
to PreParser::StrictModeIdentifierViolation.

BUG=3126
LOG=N
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/139713005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/preparser.cc
src/preparser.h

index 7d48dd8..4150d33 100644 (file)
@@ -1058,7 +1058,6 @@ PreParser::Expression PreParser::ParseMemberWithNewPrefixesExpression(
     // is strict, we need to do an extra check.
     if (result.IsStrictFunction() && !identifier.IsValidStrictVariable()) {
       StrictModeIdentifierViolation(scanner()->location(),
-                                    "strict_eval_arguments",
                                     identifier,
                                     ok);
       return Expression::Default();
@@ -1496,8 +1495,7 @@ PreParser::Identifier PreParser::ParseIdentifier(
     PreParser::Identifier name = GetIdentifierSymbol();
     if (allow_eval_or_arguments == kDontAllowEvalOrArguments &&
         !is_classic_mode() && name.IsEvalOrArguments()) {
-      StrictModeIdentifierViolation(
-          scanner()->location(), "strict_eval_arguments", name, ok);
+      StrictModeIdentifierViolation(scanner()->location(), name, ok);
     }
     return name;
   } else if (is_classic_mode() &&
@@ -1546,10 +1544,9 @@ void PreParser::CheckDelayedStrictModeViolation(int beg_pos,
 
 
 void PreParser::StrictModeIdentifierViolation(Scanner::Location location,
-                                              const char* eval_args_type,
                                               Identifier identifier,
                                               bool* ok) {
-  const char* type = eval_args_type;
+  const char* type = "strict_eval_arguments";
   if (identifier.IsFutureReserved()) {
     type = "unexpected_reserved";
   } else if (identifier.IsFutureStrictReserved() || identifier.IsYield()) {
index 0db902f..d0c7e3e 100644 (file)
@@ -681,7 +681,6 @@ class PreParser : public ParserBase {
   void CheckDelayedStrictModeViolation(int beg_pos, int end_pos, bool* ok);
 
   void StrictModeIdentifierViolation(Scanner::Location,
-                                     const char* eval_args_type,
                                      Identifier identifier,
                                      bool* ok);