JavaScriptCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Oct 2007 20:44:09 +0000 (20:44 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Oct 2007 20:44:09 +0000 (20:44 +0000)
commitc0a1a2e7c4cae4a62c9b049c0e632afdc37deb8d
tree5e84a0b5eb943f7961adb1e8883444f906de21d3
parent5cd62c4c2d84d718e87b387cf5f1ec8b85b7b1df
JavaScriptCore:

        Reviewed by Darin Adler.

        Removed surprising self-named "hack" that made nested functions
        available as named properties of their containing functions, and placed
        containing function objects in the scope chains of nested functions.

        There were a few reasons to remove this "hack:"

        1. It contradicted FF, IE, and the ECMA spec.

        2. It incurred a performance penalty, since merely parsing a function
        required parsing its body for nested functions (and so on).

        3. SVN history contains no explanation for why it was added. It was just
        legacy code in a large merge a long, long time ago.

        [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]

        * kjs/nodes.cpp:
        (FuncDeclNode::processFuncDecl):

LayoutTests:

        Reviewed by Darin Adler.

        Removed surprising self-named "hack" that made nested functions
        available as named properties of their containing functions, and placed
        containing function objects in the scope chains of nested functions.

        [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ]

        Changed this test to reflect correct behavior:

        * fast/js/kde/function-expected.txt:
        * fast/js/kde/resources/function.js: (Also removed tab characters.)

        Added this test to flesh out the behavior more:

        * fast/js/nested-function-scope-expected.txt: Added.
        * fast/js/nested-function-scope.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/nodes.cpp
LayoutTests/ChangeLog
LayoutTests/fast/js/kde/function-expected.txt
LayoutTests/fast/js/kde/resources/function.js
LayoutTests/fast/js/nested-function-scope-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/nested-function-scope.html [new file with mode: 0644]