summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-findScripts-03.js
blob: 2bc9d84de8250f9abb2c1fbc6a75e2604cc35f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// While eval code is running, findScripts returns its script.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
var log;

g.check = function () {
    log += 'c';
    var frame = dbg.getNewestFrame();
    assertEq(frame.type, "eval");
    assertEq(dbg.findScripts().indexOf(frame.script) != -1, true);
};

log = '';
g.eval('check()');
assertEq(log, 'c');