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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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