summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-executeInGlobal-08.js
blob: 3c3819f2d392432f15e5902933389f03b6703e08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// executeInGlobal correctly handles optional lineNumber option
var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
var debuggee = dbg.getDebuggees()[0];
var count = 0;

function testLineNumber (options, expected) {
    count++;
    dbg.onNewScript = function(script){
        dbg.onNewScript = undefined;
        assertEq(script.startLine, expected);
        count--;
    };
    debuggee.executeInGlobal("", options);
}


testLineNumber(undefined, 1);
testLineNumber({}, 1);
testLineNumber({ lineNumber: undefined }, 1);
testLineNumber({ lineNumber: 5 }, 5);
assertEq(count, 0);