JavaScriptCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jun 2005 08:25:26 +0000 (08:25 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jun 2005 08:25:26 +0000 (08:25 +0000)
commitb407200ba63ba2283c89e0ea9da164cfd5674b3b
tree871900da2fcf32583b22d45f9762e2a4bff596dc
parente82e7a4723cc9915a8e0d2dcb512c02e5fe950cd
JavaScriptCore:

        Reviewed by Darin(first pass) and Hyatt.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3576
        (roll in support for "const" keyword from KDE tree)
        - make processVarDecls handle deletability of variables declared
        in an eval block the same as evaluate would
        - make eval() call processVarDecls - needed to match mozilla and
        to make the second change testable

        I started with the KDE implementation of const but I ended up changing it a bit
        to avoid the use of a global variable. Now instead of the global variable it distinguishes
        const and var at the grammar level so the appropriate node can know the right kind of
        declaration.

        Test cases:
        * tests/mozilla/expected.html: Updated for one new test that is
        failing - we used to bail on it entirely because it checks for
        const support before starting.
        - see also test cases added in WebCore

        * kjs/grammar.y: Add rules for const declarations.
        * kjs/keywords.table: Add const keyword.
        * kjs/nodes.cpp:
        (VarDeclNode::VarDeclNode): Add parameter.
        (VarDeclNode::evaluate): Add const support.
        (VarDeclNode::processVarDecls): Add const support.
        (VarStatementNode::execute): Irrelevant change.
        (ForInNode::ForInNode): Tell our variable node that it's a variable.
        * kjs/nodes.h:
        (KJS::VarDeclNode::): Add declaration of type enum, extra constructor parameter.
        (KJS::VarStatementNode::VarStatementNode): Irrelevant change.
        * kjs/function.cpp:
        (KJS::GlobalFuncImp::call): Process var decls before evaluating.

WebCore:

        Reviewed by Darin(first pass) and Hyatt.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3576
        (roll in support for "const" keyword from KDE tree)
        - make processVarDecls handle deletability of variables declared
        in an eval block the same as evaluate would
        - make eval() call processVarDecls - needed to match mozilla and
        to make the second change testable

Test cases only, fix is in JavaScriptCore

        Test cases added:
        * layout-tests/fast/js/const-expected.txt: Added.
        * layout-tests/fast/js/const.html: Added.
        * layout-tests/fast/js/eval-var-decl-expected.txt: Added.
        * layout-tests/fast/js/eval-var-decl.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/function.cpp
JavaScriptCore/kjs/grammar.y
JavaScriptCore/kjs/keywords.table
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/nodes.h
JavaScriptCore/tests/mozilla/expected.html
LayoutTests/fast/js/const-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/const.html [new file with mode: 0644]
LayoutTests/fast/js/eval-var-decl-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/eval-var-decl.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23