Bug 1539821 - Part 6: Remove ModifierExceptions for propertyName(). r=jwalden
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 10 Apr 2019 14:42:53 +0000
changeset 530757 06ad5997d16183b2aa313c071a85b9814b0fd737
parent 530756 a0869df70525060e5346e8dbc062fbf47a284617
child 530758 4531b9532bd9a106f693f8749e8286b50edf8329
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1539821
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1539821 - Part 6: Remove ModifierExceptions for propertyName(). r=jwalden propertyName() has three callers, corresponding to ObjectLiteral, ObjectBindingPattern, and ClassDeclaration. In each case the next token must be neither Div nor RegExp. Differential Revision: https://phabricator.services.mozilla.com/D25821
js/src/frontend/Parser.cpp
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -3833,17 +3833,17 @@ GeneralParser<ParseHandler, Unit>::objec
       } else {
         errorAt(namePos.begin, JSMSG_NO_VARIABLE_NAME);
         return null();
       }
     }
 
     bool matched;
     if (!tokenStream.matchToken(&matched, TokenKind::Comma,
-                                TokenStream::SlashIsRegExp)) {
+                                TokenStream::SlashIsInvalid)) {
       return null();
     }
     if (!matched) {
       break;
     }
     if (tt == TokenKind::TripleDot) {
       error(JSMSG_REST_WITH_COMMA);
       return null();
@@ -6720,17 +6720,17 @@ template <class ParseHandler, typename U
 bool GeneralParser<ParseHandler, Unit>::classMember(
     YieldHandling yieldHandling, DefaultHandling defaultHandling,
     const ParseContext::ClassStatement& classStmt, HandlePropertyName className,
     uint32_t classStartOffset, HasHeritage hasHeritage, size_t& numFields,
     size_t& numFieldKeys, ListNodeType& classMembers, bool* done) {
   *done = false;
 
   TokenKind tt;
-  if (!tokenStream.getToken(&tt)) {
+  if (!tokenStream.getToken(&tt, TokenStream::SlashIsInvalid)) {
     return false;
   }
   if (tt == TokenKind::RightCurly) {
     *done = true;
     return true;
   }
 
   if (tt == TokenKind::Semi) {
@@ -9803,17 +9803,16 @@ typename ParseHandler::Node GeneralParse
       (tt == TokenKind::Comma || tt == TokenKind::RightCurly ||
        tt == TokenKind::Assign)) {
     if (isGenerator || isAsync) {
       error(JSMSG_BAD_PROP_ID);
       return null();
     }
 
     anyChars.ungetToken();
-    anyChars.addModifierException(TokenStream::SlashIsRegExpOK);
     *propType = tt == TokenKind::Assign ? PropertyType::CoverInitializedName
                                         : PropertyType::Shorthand;
     return propName;
   }
 
   if (tt == TokenKind::LeftParen) {
     anyChars.ungetToken();
 
@@ -10089,17 +10088,17 @@ GeneralParser<ParseHandler, Unit>::objec
           possibleError->setPendingDestructuringErrorAt(
               namePos, JSMSG_BAD_DESTRUCT_TARGET);
         }
       }
     }
 
     bool matched;
     if (!tokenStream.matchToken(&matched, TokenKind::Comma,
-                                TokenStream::SlashIsRegExp)) {
+                                TokenStream::SlashIsInvalid)) {
       return null();
     }
     if (!matched) {
       break;
     }
     if (tt == TokenKind::TripleDot && possibleError) {
       possibleError->setPendingDestructuringErrorAt(pos(),
                                                     JSMSG_REST_WITH_COMMA);