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 /*
2 * For eval and Function constructors, Script.prototype.sourceStart and
3 * Script.prototype.sourceLength should comprise the entire script (excluding
4 * arguments in the case of Function constructors)
5 */
6 let g = newGlobal();
7 let dbg = new Debugger(g);
9 var count = 0;
10 function test(string, range) {
11 dbg.onNewScript = function (script) {
12 ++count;
13 if (count % 2 == 0) {
14 assertEq(script.sourceStart, range[0]);
15 assertEq(script.sourceLength, range[1]);
16 }
17 }
19 g.eval(string);
20 }
22 test("eval('2 * 3')", [0, 5]);
23 test("new Function('2 * 3')", [0, 5]);
24 test("new Function('x', 'x * x')", [0, 5]);
25 assertEq(count, 6);