Changeset 26682 in webkit for trunk/JavaScriptCore/tests


Ignore:
Timestamp:
Oct 16, 2007, 2:35:50 PM (18 years ago)
Author:
ggaren
Message:

JavaScriptCore:

Reviewed by Maciej Stachowiak.


Re-structured variable and function declaration code.


Command-line JS iBench shows no regression.


Here are the changes:

  1. Function declarations are now processed at the same time as var declarations -- namely, immediately upon entry to an execution context. This does not match Firefox, which waits to process a function declaration until the declaration's containing block executes, but it does match IE and the ECMA spec. (10.1.3 states that var and function declarations should be processed at the same time -- namely, "On entering an execution context." 12.2 states that "A Block does not define a new execution scope.")
  1. Declaration processing proceeds iteratively now, rather than recursively, storing the nodes is finds in stacks. This will later facilitate an optimization to hold on to the gathered declaration nodes, rather than re-fetching them in every function call. [ http://bugs.webkit.org/show_bug.cgi?id=14868 ]

Modified these tests because they expected the incorrect Mozilla
behavior described above:

  • tests/mozilla/ecma_3/Function/scope-001.js:
  • tests/mozilla/js1_5/Scope/regress-184107.js:

LayoutTests:

Reviewed by Maciej Stachowiak.


Layout tests for http://bugs.webkit.org/show_bug.cgi?id=15478
Declare vars and functions iteratively upon entering an execution context

  • fast/js/function-declarations-expected.txt: Added.
  • fast/js/function-declarations.html: Added.
  • fast/js/var-declarations-expected.txt: Added.
  • fast/js/var-declarations.html: Added.
Location:
trunk/JavaScriptCore/tests/mozilla
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/tests/mozilla/ecma_3/Function/scope-001.js

    r11995 r26682  
    8080  actual = f();
    8181}
    82 expect = 2;
     82// Mozilla result, which contradicts IE and the ECMA spec: expect = 2;
     83expect = 1;
    8384addThis();
    8485
     
    99100}
    100101actual = f();
    101 expect = 2;
     102// Mozilla result, which contradicts IE and the ECMA spec: expect = 2;
     103expect = 1;
    102104addThis();
    103105
     
    120122}
    121123actual = f();
    122 expect = 3;
     124// Mozilla result, which contradicts IE and the ECMA spec: expect = 3;
     125expect = 1;
    123126addThis();
    124127
     
    140143delete obj;
    141144actual = f();
    142 expect = 2;
     145// Mozilla result, which contradicts IE and the ECMA spec: expect = 2;
     146expect = 1;
    143147addThis();
    144148
     
    164168  actual = f();
    165169}
    166 expect = 2;  // NOT 3 !!!
     170// Mozilla result, which contradicts IE and the ECMA spec: expect = 2;  // NOT 3 !!!
     171expect = 1;
    167172addThis();
    168173
  • trunk/JavaScriptCore/tests/mozilla/js1_5/Scope/regress-184107.js

    r11995 r26682  
    5858var expectedvalues = [];
    5959
     60y = 1;
    6061var obj = {y:10};
    6162with (obj)
     
    7879status = inSection(2);
    7980actual = f();
    80 expect = obj.y;
     81// Mozilla result, which contradicts IE and the ECMA spec: expect = obj.y;
     82expect = y;
    8183addThis();
    8284
Note: See TracChangeset for help on using the changeset viewer.