blob: 61dc3a14bd5c27deaf0f34b2b75844ee3edb6558 (
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();
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);
|