js/src/jit-test/tests/collections/Array-build-basic.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 // Array.build basics
     3 if (getBuildConfiguration().parallelJS) {
     4   load(libdir + "asserts.js");
     5   load(libdir + "eqArrayHelper.js");
     7   function myBuild(l, f) {
     8     var a = [];
     9     for (var i = 0; i < l; i++)
    10       a.push(f(i));
    11     return a;
    12   }
    14   // Test that build returns an identical, but new array.
    15   var a1 = [];
    16   for (var i = 0; i < 100; i++)
    17     a1[i] = Math.random();
    18   var a2 = Array.build(a1.length, (i) => a1[i]);
    20   assertEq(a1 === a2, false);
    21   assertEqArray(a2, a1);
    22 }

mercurial