michael@0: // We don't record introduction scripts in a different global from the michael@0: // introduced script, even if they're both debuggees. michael@0: michael@0: var dbg = new Debugger; michael@0: michael@0: var g1 = newGlobal(); michael@0: g1.g1 = g1; michael@0: var g1DO = dbg.addDebuggee(g1); michael@0: michael@0: var g2 = newGlobal(); michael@0: g2.g1 = g1; michael@0: michael@0: var log = ''; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: log += 'd'; michael@0: assertEq(frame.script.source.introductionScript, undefined); michael@0: assertEq(frame.script.source.introductionOffset, undefined); michael@0: }; michael@0: michael@0: g2.eval('g1.eval("debugger;");'); michael@0: assertEq(log, 'd'); michael@0: michael@0: // Just for sanity: when it's not cross-global, we do note the introducer. michael@0: log = ''; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: log += 'd'; michael@0: assertEq(frame.script.source.introductionScript instanceof Debugger.Script, true); michael@0: assertEq(typeof frame.script.source.introductionOffset, "number"); michael@0: }; michael@0: // Exactly as above, but with g1 instead of g2. michael@0: g1.eval('g1.eval("debugger;");'); michael@0: assertEq(log, 'd');