Ignore:
Timestamp:
Jun 21, 2005, 1:25:26 AM (20 years ago)
Author:
mjs
Message:

JavaScriptCore:

Reviewed by Darin(first pass) and Hyatt.

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.

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.