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 // Any copyright is dedicated to the Public Domain.
2 // http://creativecommons.org/licenses/publicdomain/
4 var watcherCount, setterCount;
5 function watcher(id, oldval, newval) { watcherCount++; return newval; }
6 function setter(newval) { setterCount++; }
8 var p = { set x(v) { setter(v); } };
9 p.watch('x', watcher);
11 watcherCount = setterCount = 0;
12 p.x = 2;
13 assertEq(setterCount, 1);
14 assertEq(watcherCount, 1);
16 var o = Object.defineProperty({}, 'x', { set:setter, enumerable:true, configurable:true });
17 o.watch('x', watcher);
19 watcherCount = setterCount = 0;
20 o.x = 2;
21 assertEq(setterCount, 1);
22 assertEq(watcherCount, 1);
24 reportCompare(0, 0, 'ok');