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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * Any copyright is dedicated to the Public Domain.
4 * http://creativecommons.org/licenses/publicdomain/
5 */
7 function make() {
8 var r = {};
9 r.desc = {get: function() {}};
10 r.a = Object.defineProperty({}, "prop", r.desc);
11 r.info = Object.getOwnPropertyDescriptor(r.a, "prop");
12 return r;
13 }
15 r1 = make();
16 assertEq(r1.desc.get, r1.info.get);
18 // Distinct evaluations of an object literal make distinct methods.
19 r2 = make();
20 assertEq(r1.desc.get === r2.desc.get, false);
22 r1.info.get.foo = 42;
24 assertEq(r1.desc.get.hasOwnProperty('foo'), !r2.desc.get.hasOwnProperty('foo'));
25 assertEq(r1.info.get.hasOwnProperty('foo'), !r2.info.get.hasOwnProperty('foo'));
27 reportCompare(0, 0, "ok");