summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/breakpoint-02.js
blob: 45dd4205156cff00bc9db98354f95a8a1dcc47b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Setting a breakpoint in a non-debuggee Script is an error.

load(libdir + "asserts.js");

var g1 = newGlobal({newCompartment: true});
var g2 = g1.eval("newGlobal('same-compartment')");
g2.eval("function f() { return 2; }");
g1.f = g2.f;

var dbg = Debugger(g1);
var s;
dbg.onDebuggerStatement = function (frame) { s = frame.eval("f").return.script; };
g1.eval("debugger;");

assertThrowsInstanceOf(function () { s.setBreakpoint(0, {}); }, Error);