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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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);
    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);
    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);
    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