Changeset 31072 in webkit for trunk/JavaScriptCore/kjs/Parser.cpp


Ignore:
Timestamp:
Mar 14, 2008, 6:05:55 PM (17 years ago)
Author:
[email protected]
Message:

Add logic to track whether a function uses a locally scoped eval or requires a closure

Reviewed by Maciej

Now that we limit eval we can track those uses of eval that operate
in the local scope and functions that require a closure. We track
this information during initial parsing to avoid yet another tree
walk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/Parser.cpp

    r28937 r31072  
    7373
    7474void Parser::didFinishParsing(SourceElements* sourceElements, ParserRefCountedData<DeclarationStacks::VarStack>* varStack,
    75                               ParserRefCountedData<DeclarationStacks::FunctionStack>* funcStack, int lastLine)
     75                              ParserRefCountedData<DeclarationStacks::FunctionStack>* funcStack, bool usesEval, bool needsClosure, int lastLine)
    7676{
    7777    m_sourceElements = sourceElements ? sourceElements : new SourceElements;
    7878    m_varDeclarations = varStack;
    7979    m_funcDeclarations = funcStack;
     80    m_usesEval = usesEval;
     81    m_needsClosure = needsClosure;
    8082    m_lastLine = lastLine;
    8183}
Note: See TracChangeset for help on using the changeset viewer.