Bug 1424946 - Move GeneralParser::noSubstitutionTaggedTemplate into a baser class. r=arai
authorJeff Walden <jwalden@mit.edu>
Tue, 12 Dec 2017 15:21:01 -0600
changeset 448167 4a33f75559363e07fb22c255eb079a4c2426acac
parent 448166 87c33d6cfcd86b6b7ee0a2fdfed0daaedb5f6374
child 448168 a04b126b89102f681e8a4423cdfbb0c50a8f6e0e
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1424946
milestone59.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 1424946 - Move GeneralParser::noSubstitutionTaggedTemplate into a baser class. r=arai
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -8888,19 +8888,19 @@ PerHandlerParser<ParseHandler>::identifi
 
 template <class ParseHandler>
 typename ParseHandler::Node
 PerHandlerParser<ParseHandler>::stringLiteral()
 {
     return handler.newStringLiteral(anyChars.currentToken().atom(), pos());
 }
 
-template <class ParseHandler, typename CharT>
+template <class ParseHandler>
 typename ParseHandler::Node
-GeneralParser<ParseHandler, CharT>::noSubstitutionTaggedTemplate()
+PerHandlerParser<ParseHandler>::noSubstitutionTaggedTemplate()
 {
     if (anyChars.hasInvalidTemplateEscape()) {
         anyChars.clearInvalidTemplateEscape();
         return handler.newRawUndefinedLiteral(pos());
     }
 
     return handler.newTemplateStringLiteral(anyChars.currentToken().atom(), pos());
 }
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -356,16 +356,18 @@ class PerHandlerParser
     inline Node newName(PropertyName* name, TokenPos pos);
 
     Node newInternalDotName(HandlePropertyName name);
     Node newThisName();
     Node newDotGeneratorName();
 
     Node identifierReference(Handle<PropertyName*> name);
 
+    Node noSubstitutionTaggedTemplate();
+
     inline bool processExport(Node node);
     inline bool processExportFrom(Node node);
 
     // If ParseHandler is SyntaxParseHandler:
     //   Do nothing.
     // If ParseHandler is FullParseHandler:
     //   Disable syntax parsing of all future inner functions during this
     //   full-parse.
@@ -552,16 +554,17 @@ class GeneralParser
     using Base::finishFunction;
     using Base::hasUsedName;
     using Base::identifierReference;
     using Base::leaveInnerFunction;
     using Base::newDotGeneratorName;
     using Base::newInternalDotName;
     using Base::newThisName;
     using Base::nextTokenContinuesLetDeclaration;
+    using Base::noSubstitutionTaggedTemplate;
     using Base::noteDestructuredPositionalFormalParameter;
     using Base::noteUsedName;
     using Base::prefixAccessorName;
     using Base::processExport;
     using Base::processExportFrom;
 
   private:
     inline FinalParser* asFinalParser();
@@ -769,17 +772,16 @@ class GeneralParser
      * If extra warnings are enabled, report the given warning at the given
      * offset.
      */
     MOZ_MUST_USE bool extraWarningAt(uint32_t offset, unsigned errorNumber, ...);
 
   private:
     GeneralParser* thisForCtor() { return this; }
 
-    Node noSubstitutionTaggedTemplate();
     Node noSubstitutionUntaggedTemplate();
     Node templateLiteral(YieldHandling yieldHandling);
     bool taggedTemplate(YieldHandling yieldHandling, Node nodeList, TokenKind tt);
     bool appendToCallSiteObj(Node callSiteObj);
     bool addExprAndGetNextTemplStrToken(YieldHandling yieldHandling, Node nodeList,
                                         TokenKind* ttp);
 
     inline bool trySyntaxParseInnerFunction(Node funcNode, HandleFunction fun,