Changeset 278588 in webkit for trunk/Source/JavaScriptCore/parser/Parser.h
- Timestamp:
- Jun 7, 2021, 6:43:14 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Parser.h
r278253 r278588 148 148 149 149 public: 150 Scope(const VM& vm, bool isFunction, bool isGenerator, bool strictMode, bool isArrowFunction, bool isAsyncFunction)150 Scope(const VM& vm, LexicalScopeFeatures lexicalScopeFeatures, bool isFunction, bool isGenerator, bool isArrowFunction, bool isAsyncFunction) 151 151 : m_vm(vm) 152 152 , m_shadowsArguments(false) … … 157 157 , m_allowsVarDeclarations(true) 158 158 , m_allowsLexicalDeclarations(true) 159 , m_ strictMode(strictMode)159 , m_lexicalScopeFeatures(lexicalScopeFeatures) 160 160 , m_isFunction(isFunction) 161 161 , m_isGenerator(isGenerator) … … 757 757 } 758 758 } 759 void setStrictMode() { m_strictMode = true; } 760 bool strictMode() const { return m_strictMode; } 759 LexicalScopeFeatures lexicalScopeFeatures() const { return m_lexicalScopeFeatures; } 760 void setStrictMode() { m_lexicalScopeFeatures |= StrictModeLexicalFeature; } 761 bool strictMode() const { return m_lexicalScopeFeatures & StrictModeLexicalFeature; } 761 762 bool isValidStrictMode() const { return m_isValidStrictMode; } 762 763 bool shadowsArguments() const { return m_shadowsArguments; } … … 781 782 ASSERT(m_isFunction); 782 783 parameters.usesEval = m_usesEval; 783 parameters. strictMode = m_strictMode;784 parameters.lexicalScopeFeatures = m_lexicalScopeFeatures; 784 785 parameters.needsFullActivation = m_needsFullActivation; 785 786 parameters.innerArrowFunctionFeatures = m_innerArrowFunctionFeatures; … … 805 806 ASSERT(m_isFunction); 806 807 m_usesEval = info->usesEval; 807 m_ strictMode = info->strictMode;808 m_lexicalScopeFeatures = info->lexicalScopeFeatures(); 808 809 m_innerArrowFunctionFeatures = info->innerArrowFunctionFeatures; 809 810 m_needsFullActivation = info->needsFullActivation; … … 905 906 bool m_allowsVarDeclarations; 906 907 bool m_allowsLexicalDeclarations; 907 bool m_strictMode;908 LexicalScopeFeatures m_lexicalScopeFeatures; 908 909 bool m_isFunction; 909 910 bool m_isGenerator; … … 1326 1327 ScopeRef pushScope() 1327 1328 { 1329 LexicalScopeFeatures lexicalScopeFeatures = NoLexicalFeatures; 1328 1330 bool isFunction = false; 1329 bool isStrict = false;1330 1331 bool isGenerator = false; 1331 1332 bool isArrowFunction = false; 1332 1333 bool isAsyncFunction = false; 1333 1334 if (!m_scopeStack.isEmpty()) { 1334 isStrict = m_scopeStack.last().strictMode();1335 lexicalScopeFeatures = m_scopeStack.last().lexicalScopeFeatures(); 1335 1336 isFunction = m_scopeStack.last().isFunction(); 1336 1337 isGenerator = m_scopeStack.last().isGenerator(); … … 1338 1339 isAsyncFunction = m_scopeStack.last().isAsyncFunction(); 1339 1340 } 1340 m_scopeStack.constructAndAppend(m_vm, isFunction, isGenerator, isStrict, isArrowFunction, isAsyncFunction);1341 m_scopeStack.constructAndAppend(m_vm, lexicalScopeFeatures, isFunction, isGenerator, isArrowFunction, isAsyncFunction); 1341 1342 return currentScope(); 1342 1343 } … … 1672 1673 void startSwitch() { currentScope()->startSwitch(); } 1673 1674 void endSwitch() { currentScope()->endSwitch(); } 1675 LexicalScopeFeatures lexicalScopeFeatures() { return currentScope()->lexicalScopeFeatures(); } 1674 1676 void setStrictMode() { currentScope()->setStrictMode(); } 1675 1677 bool strictMode() { return currentScope()->strictMode(); } … … 2178 2180 *m_source, 2179 2181 parseResult.value().features, 2182 currentScope()->lexicalScopeFeatures(), 2180 2183 currentScope()->innerArrowFunctionFeatures(), 2181 2184 parseResult.value().numConstants,
Note:
See TracChangeset
for help on using the changeset viewer.