Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/fixtures/debugger/probe-throwing-getter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
12 changes: 6 additions & 6 deletions test/parallel/test-debugger-probe-expression-throws.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<stack>',
details: {
Expand All @@ -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',
Expand Down
Loading