Bug 1498320 - Add a UTF-8 parser to the Variant inside EitherParser. r=tcampbell
authorJeff Walden <jwalden@mit.edu>
Fri, 26 Oct 2018 21:57:24 -0700
changeset 502949 ba6ba95b3cd24e79ea99df4adb2ab4e7be1d7d0a
parent 502948 774a0684f72479571a325c28442cb87bd1858c8a
child 502950 1dd5267839b3ccd35c62bcff81f7b8c60304f13e
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1498320
milestone65.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 1498320 - Add a UTF-8 parser to the Variant inside EitherParser. r=tcampbell
js/src/frontend/EitherParser.h
--- a/js/src/frontend/EitherParser.h
+++ b/js/src/frontend/EitherParser.h
@@ -11,16 +11,17 @@
 
 #ifndef frontend_EitherParser_h
 #define frontend_EitherParser_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Move.h"
 #include "mozilla/Tuple.h"
 #include "mozilla/TypeTraits.h"
+#include "mozilla/Utf8.h"
 #include "mozilla/Variant.h"
 
 #include <utility>
 
 #include "frontend/BCEParserHandle.h"
 #include "frontend/Parser.h"
 #include "frontend/TokenStream.h"
 
@@ -122,17 +123,18 @@ struct ErrorReporterMatcher
 
 } // namespace detail
 
 namespace frontend {
 
 class EitherParser : public BCEParserHandle
 {
     // Leave this as a variant, to promote good form until 8-bit parser integration.
-    mozilla::Variant<Parser<FullParseHandler, char16_t>* const> parser;
+    mozilla::Variant<Parser<FullParseHandler, char16_t>* const,
+                     Parser<FullParseHandler, mozilla::Utf8Unit>* const> parser;
 
     using Node = typename FullParseHandler::Node;
 
     template<template <class Parser> class GetThis,
              template <class This> class GetMemberFunction,
              typename... StoredArgs>
     using InvokeMemberFunction =
         detail::InvokeMemberFunction<GetThis, GetMemberFunction, StoredArgs...>;