Changeset 174610 in webkit for trunk/Source/JavaScriptCore/parser
- Timestamp:
- Oct 10, 2014, 1:30:32 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore/parser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Nodes.h
r174606 r174610 1441 1441 bool usesArguments() const { return (m_features & ArgumentsFeature) && !(m_features & ShadowsArgumentsFeature); } 1442 1442 bool modifiesParameter() const { return m_features & ModifiedParameterFeature; } 1443 bool modifiesArguments() const { return m_features & (EvalFeature | ModifiedArgumentsFeature); }1444 1443 bool isStrictMode() const { return m_features & StrictModeFeature; } 1445 1444 void setUsesArguments() { m_features |= ArgumentsFeature; } -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r174606 r174610 272 272 IdentifierSet capturedVariables; 273 273 bool modifiedParameter = false; 274 bool modifiedArguments = false; 275 scope->getCapturedVariables(capturedVariables, modifiedParameter, modifiedArguments); 274 scope->getCapturedVariables(capturedVariables, modifiedParameter); 276 275 277 276 CodeFeatures features = context.features(); … … 282 281 if (modifiedParameter) 283 282 features |= ModifiedParameterFeature; 284 if (modifiedArguments) 285 features |= ModifiedArgumentsFeature; 283 286 284 Vector<RefPtr<StringImpl>> closedVariables; 287 285 if (m_parsingBuiltin) { … … 295 293 if (scope->hasDeclaredParameter(Identifier(m_vm, variable.get()))) 296 294 continue; 297 298 if (variable == m_vm->propertyNames->arguments.impl())299 continue;300 301 295 closedVariables.append(variable); 302 296 } -
trunk/Source/JavaScriptCore/parser/Parser.h
r174606 r174610 280 280 } 281 281 282 void getCapturedVariables(IdentifierSet& capturedVariables, bool& modifiedParameter , bool& modifiedArguments)282 void getCapturedVariables(IdentifierSet& capturedVariables, bool& modifiedParameter) 283 283 { 284 284 if (m_needsFullActivation || m_usesEval) { … … 293 293 } 294 294 modifiedParameter = false; 295 if (shadowsArguments())296 modifiedArguments = true;297 295 if (m_declaredParameters.size()) { 298 296 IdentifierSet::iterator end = m_writtenVariables.end(); 299 297 for (IdentifierSet::iterator ptr = m_writtenVariables.begin(); ptr != end; ++ptr) { 300 if (*ptr == m_vm->propertyNames->arguments.impl())301 modifiedArguments = true;302 298 if (!m_declaredParameters.contains(*ptr)) 303 299 continue; -
trunk/Source/JavaScriptCore/parser/ParserModes.h
r174606 r174610 76 76 const CodeFeatures ShadowsArgumentsFeature = 1 << 6; 77 77 const CodeFeatures ModifiedParameterFeature = 1 << 7; 78 const CodeFeatures ModifiedArgumentsFeature = 1 << 8;79 78 80 79 const CodeFeatures AllFeatures = EvalFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature | StrictModeFeature | ShadowsArgumentsFeature | ModifiedParameterFeature;
Note:
See TracChangeset
for help on using the changeset viewer.