Clean up ENABLE(ES6_ARROWFUNCTION_SYNTAX) ifdefs and keep minimal set of them
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 10:36:20 +0000 (10:36 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 10:36:20 +0000 (10:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150793

Reviewed by Darin Adler.

Fix the !ENABLE(ES6_ARROWFUNCTION_SYNTAX) build after r191875.
This patch drops many ENABLE(ES6_ARROWFUNCTION_SYNTAX) ifdefs and keep only one of them;
the ifdef in parseAssignmentExpression.
This prevents functionality of parsing arrow function syntax.

* parser/Lexer.cpp:
(JSC::Lexer<T>::lex):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner): Deleted.
* parser/Parser.h:
(JSC::Parser::isArrowFunctionParamters): Deleted.
* parser/ParserTokens.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191946 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Lexer.cpp
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/Parser.h
Source/JavaScriptCore/parser/ParserTokens.h

index 0fb102a..5a1050d 100644 (file)
@@ -1,3 +1,23 @@
+2015-11-03  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Clean up ENABLE(ES6_ARROWFUNCTION_SYNTAX) ifdefs and keep minimal set of them
+        https://bugs.webkit.org/show_bug.cgi?id=150793
+
+        Reviewed by Darin Adler.
+
+        Fix the !ENABLE(ES6_ARROWFUNCTION_SYNTAX) build after r191875.
+        This patch drops many ENABLE(ES6_ARROWFUNCTION_SYNTAX) ifdefs and keep only one of them;
+        the ifdef in parseAssignmentExpression.
+        This prevents functionality of parsing arrow function syntax.
+
+        * parser/Lexer.cpp:
+        (JSC::Lexer<T>::lex):
+        * parser/Parser.cpp:
+        (JSC::Parser<LexerType>::parseInner): Deleted.
+        * parser/Parser.h:
+        (JSC::Parser::isArrowFunctionParamters): Deleted.
+        * parser/ParserTokens.h:
+
 2015-11-02  Michael Saboff  <msaboff@apple.com>
 
         WebInspector crashed while viewing Timeline when refreshing cnn.com while it was already loading
index 46d0ca1..cb086e2 100644 (file)
@@ -1850,7 +1850,6 @@ start:
         token = GT;
         break;
     case CharacterEqual: {
-#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
         if (peek(1) == '>') {
             token = ARROWFUNCTION;
             tokenData->line = lineNumber();
@@ -1861,7 +1860,7 @@ start:
             shift();
             break;
         }
-#endif
+
         shift();
         if (m_current == '=') {
             shift();
index 806666c..2ede61f 100644 (file)
@@ -250,14 +250,12 @@ String Parser<LexerType>::parseInner(const Identifier& calleeName, SourceParseMo
         parseFunctionParameters(context, parseMode, functionInfo);
         m_parameters = functionInfo.parameters;
 
-#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
         if (parseMode == SourceParseMode::ArrowFunctionMode && !hasError()) {
             // The only way we could have an error wile reparsing is if we run out of stack space.
             RELEASE_ASSERT(match(ARROWFUNCTION));
             next();
             isArrowFunctionBodyExpression = !match(OPENBRACE);
         }
-#endif
     }
 
     if (!calleeName.isNull())
index 07ad334..d4e6e99 100644 (file)
@@ -961,7 +961,6 @@ private:
     
     ALWAYS_INLINE bool isArrowFunctionParamters()
     {
-#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
         bool isArrowFunction = false;
         
         if (match(EOFTOK))
@@ -992,9 +991,6 @@ private:
         restoreSavePoint(saveArrowFunctionPoint);
         
         return isArrowFunction;
-#else
-        return false;
-#endif
     }
     
     ALWAYS_INLINE unsigned tokenStart()
index 43666f2..9fef334 100644 (file)
@@ -118,9 +118,7 @@ enum JSTokenType {
     XOREQUAL,
     OREQUAL,
     DOTDOTDOT,
-#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
     ARROWFUNCTION,
-#endif
     LastUntaggedToken,
 
     // Begin tagged tokens