summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Script-source-02.js
blob: 43bb375d22eccf1d970fd8a460e1e64e934f7081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * Script.prototype.source should be the same object for both the top-level
 * script and the script of functions accessed as debuggee values on the global
 */
let g = newGlobal({newCompartment: true});
let dbg = new Debugger();
let gw = dbg.addDebuggee(g);

let count = 0;
dbg.onDebuggerStatement = function (frame) {
    ++count;
    assertEq(frame.script.source, gw.makeDebuggeeValue(g.f).script.source);
}

g.eval("function f() {}; debugger;");
assertEq(count, 1);