Sat, 03 Jan 2015 20:18:00 +0100
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 // map.iterator() and iter.next() are non-generic but work on cross-compartment wrappers.
3 load(libdir + "asserts.js");
4 load(libdir + "iteration.js");
6 var g = newGlobal();
8 var iterator_fn = Set.prototype[std_iterator];
9 assertThrowsInstanceOf(function () { iterator_fn.call({}); }, TypeError);
10 assertThrowsInstanceOf(function () { iterator_fn.call(Map()); }, TypeError);
11 var setw = g.eval("Set(['x', 'y'])");
12 assertIteratorNext(iterator_fn.call(setw), "x");
14 var next_fn = Set()[std_iterator]().next;
15 assertThrowsInstanceOf(function () { next_fn.call({}); }, TypeError);
16 assertThrowsInstanceOf(function () { next_fn.call(Map()[std_iterator]()); }, TypeError);
17 var iterw = setw[std_iterator]();
18 assertIteratorResult(next_fn.call(iterw), "x", false);
19 assertIteratorResult(next_fn.call(iterw), "y", false);
20 assertIteratorResult(next_fn.call(iterw), undefined, true);