for (var s of cases) { // Test triggering the debugger right in the scope in which x is bound.
test(s, "eval(\"\"); debugger; assertEq(x, 'ok');");
// Test calling a function that triggers the debugger.
test(s, "debugMe(); assertEq(x, 'ok');");
// Test triggering the debugger from a scope nested in x's scope.
test(s, "{ let y = 'irrelevant'; (function (z) { { let zz = y; eval(\"\"); debugger; } })(); } assertEq(x, 'ok');"),
// Test closing over the variable and triggering the debugger later, after // leaving the variable's scope.
test(s, "capture = {dbg: function () { eval(\"\"); debugger; }, get x() { return x; }};", "assertEq(capture.x, VAL); capture.dbg(); assertEq(capture.x, 'ok');");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.