summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Script-isModule-04.js
blob: a46557c09a9c653876b691e7a01f6c8431d3f538 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Debugger.Object.prototype.isModule

const g = newGlobal({newCompartment: true});
const dbg = Debugger(g);
let count = 0;
dbg.onNewScript = function (script) {
    count += 1;
    assertEq(script.isModule, true);
};
dbg.onDebuggerStatement = function (frame) {
    const { script } = frame;

    assertEq(script.isModule, false);
};
const m = g.parseModule("(function(){ debugger; })()");
moduleLink(m);
moduleEvaluate(m);

assertEq(count, 1);