summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Script-getChildScripts-03.js
blob: 2e29a7c864833f86d96510911fb5eddcff1ec55d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// getChildScripts on a direct eval script returns the right scripts.
// (A bug had it also returning the script for the calling function.)

var g = newGlobal();
var dbg = Debugger(g);
var hits = 0;
dbg.onDebuggerStatement = function (frame) {
    var arr = frame.script.getChildScripts();
    assertEq(arr.length, 1);
    assertEq(arr[0], frame.eval("h").return.script);
    hits++;
};

g.eval("function f(s) { eval(s); }");
g.f("debugger; function h(a) { return a + 1; }");
assertEq(hits, 1);