js/src/jit-test/tests/arguments/dynamicBindings.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:082812118537
1
2 function testEval(x, y) {
3 x = 5;
4 eval("arguments[0] += 10");
5 assertEq(x, 15);
6 }
7 for (var i = 0; i < 5; i++)
8 testEval(3);
9
10 function testEvalWithArguments(x, y) {
11 eval("arguments[0] += 10");
12 assertEq(arguments[y], 13);
13 }
14 for (var i = 0; i < 5; i++)
15 testEvalWithArguments(3, 0);
16
17 function testNestedEval(x, y) {
18 x = 5;
19 eval("eval('arguments[0] += 10')");
20 assertEq(x, 15);
21 }
22 for (var i = 0; i < 5; i++)
23 testNestedEval(3);
24
25 function testWith(x, y) {
26 with ({}) {
27 arguments[0] += 10;
28 assertEq(x, 13);
29 }
30 }
31 for (var i = 0; i < 5; i++)
32 testWith(3);

mercurial