js/src/jit-test/tests/debug/Source-introductionScript-03.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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.

michael@0 1 // We don't record introduction scripts in a different global from the
michael@0 2 // introduced script, even if they're both debuggees.
michael@0 3
michael@0 4 var dbg = new Debugger;
michael@0 5
michael@0 6 var g1 = newGlobal();
michael@0 7 g1.g1 = g1;
michael@0 8 var g1DO = dbg.addDebuggee(g1);
michael@0 9
michael@0 10 var g2 = newGlobal();
michael@0 11 g2.g1 = g1;
michael@0 12
michael@0 13 var log = '';
michael@0 14 dbg.onDebuggerStatement = function (frame) {
michael@0 15 log += 'd';
michael@0 16 assertEq(frame.script.source.introductionScript, undefined);
michael@0 17 assertEq(frame.script.source.introductionOffset, undefined);
michael@0 18 };
michael@0 19
michael@0 20 g2.eval('g1.eval("debugger;");');
michael@0 21 assertEq(log, 'd');
michael@0 22
michael@0 23 // Just for sanity: when it's not cross-global, we do note the introducer.
michael@0 24 log = '';
michael@0 25 dbg.onDebuggerStatement = function (frame) {
michael@0 26 log += 'd';
michael@0 27 assertEq(frame.script.source.introductionScript instanceof Debugger.Script, true);
michael@0 28 assertEq(typeof frame.script.source.introductionOffset, "number");
michael@0 29 };
michael@0 30 // Exactly as above, but with g1 instead of g2.
michael@0 31 g1.eval('g1.eval("debugger;");');
michael@0 32 assertEq(log, 'd');

mercurial