]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/function-name-scope.js
2 return function bar(str
) {
4 var result
= eval(str
);
19 function verify(result
, barAfter
, evalResult
) {
20 if (result
[0] !== bar
)
21 throw "Error: bad first entry: " + result
[0];
22 if (result
[1] !== barAfter
)
23 throw "Error: bad first entry: " + result
[1];
24 var subResult
= result
[2]();
25 if (subResult
!== barAfter
)
26 throw "Error: bad second entry: " + result
[2] + "; returned: " + subResult
;
27 if (result
[3] !== evalResult
)
28 throw "Error: bad third entry: " + result
[3] + "; expected: " + evalResult
;
31 verify(bar("42"), bar
, 42);
32 verify(bar("bar"), bar
, bar
);
33 verify(bar("var bar = 42; function fuzz() { return bar; }; fuzz()"), 42, 42);
36 // Execute check() more than once. At the time that we wrote this regression test, trunk would fail on
37 // the second execution. Executing 100 times would also gives us some optimizing JIT coverage.
38 for (var i
= 0; i
< 100; ++i
)