var exception = null;
var log = []
function f() {
var l1 = 1,
l2,
l3 = 3;
let l4,
l5 = 5,
l6 = 6;
const l7 = 7,
l8 = 8,
l9 = 9;
return 0
;
}
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
var line = exec_state.frame(0).sourceLineText();
var col = exec_state.frame(0).sourceColumn();
print(line);
var match = line.match(/\/\/ (\w)$/);
assertEquals(2, match.length);
log.push(match[1] + col);
if (match[1] != "v") {
exec_state.prepareStep(Debug.StepAction.StepInto);
}
} catch (e) {
exception = e;
}
}
var Debug = debug.Debug;
Debug.setListener(listener);
debugger;
var g1 = 1,
g2 = 2,
g3;
let g4 = 4,
g5,
g6 = 6;
const g7 = 7,
g8 = 8,
g9 = f();
Debug.setListener(null);
assertNull(exception);
var expected = [
"a0",
"b9","c9",
"e9","f4","g9",
"h11","i11","j11",
"l11","n11",
"o6","p11","q11",
"r13","s13","t13",
"u2","v3",
];
assertEquals(expected, log);