js/src/jit-test/tests/basic/call.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.

     1 function glob_f1() {
     2   return 1;
     3 }
     4 function glob_f2() {
     5   return glob_f1();
     6 }
     7 function call()
     8 {
     9   var q1 = 0, q2 = 0, q3 = 0, q4 = 0, q5 = 0;
    10   var o = {};
    11   function f1() {
    12       return 1;
    13   }
    14   function f2(f) {
    15       return f();
    16   }
    17   o.f = f1;
    18   for (var i = 0; i < 100; ++i) {
    19       q1 += f1();
    20       q2 += f2(f1);
    21       q3 += glob_f1();
    22       q4 += o.f();
    23       q5 += glob_f2();
    24   }
    25   var ret = String([q1, q2, q3, q4, q5]);
    26   return ret;
    27 }
    28 assertEq(call(), "100,100,100,100,100");

mercurial