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

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     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