diff --git a/test/fixtures/debugger/probe-throwing-getter.js b/test/fixtures/debugger/probe-throwing-getter.js index 906e464f98dd87..9ba86589a8b592 100644 --- a/test/fixtures/debugger/probe-throwing-getter.js +++ b/test/fixtures/debugger/probe-throwing-getter.js @@ -13,9 +13,10 @@ function markProbesDone() { module.exports = { holder, markProbesDone }; -globalThis.probeLine1 = 1; -globalThis.probeLine2 = 2; - const interval = setInterval(() => { + // Keep these module bindings visible to probe evaluation from this callback. + void holder; void markProbesDone; + globalThis.probeLine1 = 1; + globalThis.probeLine2 = 2; if (probesDone) clearInterval(interval); }, 50); diff --git a/test/parallel/test-debugger-probe-expression-throws.js b/test/parallel/test-debugger-probe-expression-throws.js index 97c5e94d0485e2..9efa0a61a77ec3 100644 --- a/test/parallel/test-debugger-probe-expression-throws.js +++ b/test/parallel/test-debugger-probe-expression-throws.js @@ -12,16 +12,16 @@ const { assertProbeJson } = require('../common/debugger-probe'); const cwd = fixtures.path('debugger'); const fixture = 'probe-throwing-getter.js'; const probes = [ - { expr: 'holder.throwingGetter', target: { suffix: fixture, line: 16 } }, + { expr: 'holder.throwingGetter', target: { suffix: fixture, line: 19 } }, // This clears the interval so the process will exit naturally. - { expr: 'markProbesDone()', target: { suffix: fixture, line: 17 } }, + { expr: 'markProbesDone()', target: { suffix: fixture, line: 20 } }, ]; const url = fixtures.fileURL('debugger', fixture).href; spawnSyncAndExit(process.execPath, [ 'inspect', '--json', - '--probe', `${fixture}:16`, '--expr', probes[0].expr, - '--probe', `${fixture}:17`, '--expr', probes[1].expr, + '--probe', `${fixture}:19`, '--expr', probes[0].expr, + '--probe', `${fixture}:20`, '--expr', probes[1].expr, fixture, ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { status: 0, @@ -34,7 +34,7 @@ spawnSyncAndExit(process.execPath, [ probe: 0, event: 'hit', hit: 1, - location: { url, line: 16, column: 1 }, + location: { url, line: 19, column: 3 }, error: { message: 'Error: boom\n', details: { @@ -53,7 +53,7 @@ spawnSyncAndExit(process.execPath, [ probe: 1, event: 'hit', hit: 1, - location: { url, line: 17, column: 1 }, + location: { url, line: 20, column: 3 }, result: { type: 'undefined' }, }, { event: 'completed',