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 // env.find() finds noneumerable properties in with statements.
3 var g = newGlobal();
4 var dbg = Debugger(g);
5 var hits = 0;
6 g.h = function () {
7 var frame = dbg.getNewestFrame();
8 var target = frame.eval("obj").return;
9 var env = frame.environment.find("PI");
10 assertEq(env.object, target);
11 hits++;
12 };
14 g.obj = g.Math;
15 g.eval("with (obj) h();");
16 g.eval("with (Math) { let x = 12; h(); }");
17 g.eval("obj = {};\n" +
18 "Object.defineProperty(obj, 'PI', {enumerable: false, value: 'Marlowe'});\n" +
19 "with (obj) h();\n");
20 assertEq(hits, 3);