js/src/jit-test/tests/collections/Map-iterator-pairs-1.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 // mapiter.next() returns an actual array.
     3 load(libdir + "iteration.js");
     5 var key = {};
     6 var map = Map([[key, 'value']]);
     7 var entry = map[std_iterator]().next().value;
     8 assertEq(Array.isArray(entry), true);
     9 assertEq(Object.getPrototypeOf(entry), Array.prototype);
    10 assertEq(Object.isExtensible(entry), true);
    12 assertEq(entry.length, 2);
    13 var names = Object.getOwnPropertyNames(entry).sort();
    14 assertEq(names.length, 3);
    15 assertEq(names.join(","), "0,1,length");
    16 assertEq(entry[0], key);
    17 assertEq(entry[1], 'value');

mercurial