浏览代码

Clean up some unnecessary usage of ScriptContext

Ed Maurer 8 年之前
父节点
当前提交
f2b06bb2e6
共有 4 个文件被更改,包括 5 次插入7 次删除
  1. 1 1
      lib/Parser/CharClassifier.cpp
  2. 1 4
      lib/Parser/CharClassifier.h
  3. 2 1
      lib/Parser/Parse.cpp
  4. 1 1
      lib/Runtime/Base/ScriptContext.cpp

+ 1 - 1
lib/Parser/CharClassifier.cpp

@@ -406,7 +406,7 @@ bool Js::CharClassifier::IsIdContinueFast(codepoint_t ch) const
     return isBigChar ? this->bigCharIsIdContinueFunc(ch, this) : (charFlags[ch] & CharacterTypeFlags::IdChar) != 0;
 }
 
-Js::CharClassifier::CharClassifier(ScriptContext * scriptContext)
+Js::CharClassifier::CharClassifier(void)
 {
     bool isES6UnicodeModeEnabled = CONFIG_FLAG(ES6Unicode);
     bool isFullUnicodeSupportAvailable = PlatformAgnostic::UnicodeText::IsExternalUnicodeLibraryAvailable();

+ 1 - 4
lib/Parser/CharClassifier.h

@@ -145,9 +145,6 @@ namespace Js
         const OLECHAR* (*skipIdentifierFunc)(LPCOLESTR pcz, const CharClassifier* instance);
         const LPCUTF8 (*skipIdentifierStartEndFunc)(LPCUTF8 psz, LPCUTF8 end, const CharClassifier* instance);
 
-        void initClassifier(ScriptContext* scriptContext, CharClassifierModes identifierSupport,
-            CharClassifierModes whiteSpaceSupport, CharClassifierModes generalCharClassificationSupport, bool codePointSupport, bool isES6UnicodeVerboseEnabled, CharClassifierModes fallbackMode = CharClassifierModes::ES5);
-
     public:
 
         CharTypes GetCharType(codepoint_t ch) const;
@@ -262,7 +259,7 @@ namespace Js
             return SkipIdentifier(psz);
         }
 
-        CharClassifier(Js::ScriptContext* scriptContext);
+        CharClassifier(void);
     };
 
 };

+ 2 - 1
lib/Parser/Parse.cpp

@@ -3727,7 +3727,6 @@ ParseNodePtr Parser::ParsePostfixOperators(
                 }
                 else
                 {
-                    bool fCallIsEval = false;
                     if (!fAllowCall)
                     {
                         return pnode;
@@ -3749,6 +3748,8 @@ ParseNodePtr Parser::ParsePostfixOperators(
                     // We now detect this case up front in ParseFncDecl, which is cheaper and simpler.
                     if (buildAST)
                     {
+						bool fCallIsEval = false;
+
                         // Detect super()
                         if (this->NodeIsSuperName(pnode))
                         {

+ 1 - 1
lib/Runtime/Base/ScriptContext.cpp

@@ -321,7 +321,7 @@ namespace Js
 
     void ScriptContext::InitializeAllocations()
     {
-        this->charClassifier = Anew(GeneralAllocator(), CharClassifier, this);
+        this->charClassifier = Anew(GeneralAllocator(), CharClassifier);
 
         this->valueOfInlineCache = AllocatorNewZ(InlineCacheAllocator, GetInlineCacheAllocator(), InlineCache);
         this->toStringInlineCache = AllocatorNewZ(InlineCacheAllocator, GetInlineCacheAllocator(), InlineCache);