Ignore:
Timestamp:
Sep 6, 2012, 6:42:53 PM (13 years ago)
Author:
[email protected]
Message:

Source/JavaScriptCore: Rolled back in <http://trac.webkit.org/changeset/127698> with a fix for
fast/dom/HTMLScriptElement/script-reexecution-pretty-diff.html, which
is to make sure that function declarations don't put their names in scope.

Reviewed by Gavin Barraclough.

Named functions should not allocate scope objects for their names
https://bugs.webkit.org/show_bug.cgi?id=95659

Reviewed by Oliver Hunt.

LayoutTests: Rolled back in <http://trac.webkit.org/changeset/127698> with a fix for
fast/dom/HTMLScriptElement/script-reexecution-pretty-diff.html.

Added a more explicit test for the feature I broke in
fast/dom/HTMLScriptElement/script-reexecution-pretty-diff.html.

Reviewed by Gavin Barraclough.

Named functions should not allocate scope objects for their names
https://bugs.webkit.org/show_bug.cgi?id=95659

Reviewed by Oliver Hunt.

  • fast/dom/HTMLScriptElement/script-reexecution.html:
  • fast/js/function-name-is-in-scope-expected.txt: Added.
  • fast/js/function-name-is-in-scope.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Nodes.h

    r127666 r127810  
    14041404    };
    14051405
     1406    enum FunctionNameIsInScopeToggle { FunctionNameIsNotInScope, FunctionNameIsInScope };
    14061407    class FunctionBodyNode : public ScopeNode {
    14071408    public:
     
    14151416        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    14161417
    1417         void finishParsing(const SourceCode&, ParameterNode*, const Identifier&);
    1418         void finishParsing(PassRefPtr<FunctionParameters>, const Identifier&);
     1418        void finishParsing(const SourceCode&, ParameterNode*, const Identifier&, FunctionNameIsInScopeToggle);
     1419        void finishParsing(PassRefPtr<FunctionParameters>, const Identifier&, FunctionNameIsInScopeToggle);
    14191420       
    14201421        const Identifier& ident() { return m_ident; }
     
    14221423        const Identifier& inferredName() { return m_inferredName.isEmpty() ? m_ident : m_inferredName; }
    14231424
     1425        bool functionNameIsInScope() { return m_functionNameIsInScopeToggle == FunctionNameIsInScope; }
     1426        FunctionNameIsInScopeToggle functionNameIsInScopeToggle() { return m_functionNameIsInScopeToggle; }
     1427
    14241428        static const bool scopeIsFunction = true;
    14251429
     
    14301434        Identifier m_ident;
    14311435        Identifier m_inferredName;
     1436        FunctionNameIsInScopeToggle m_functionNameIsInScopeToggle;
    14321437        RefPtr<FunctionParameters> m_parameters;
    14331438    };
Note: See TracChangeset for help on using the changeset viewer.