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: 5 additions & 2 deletions lib/internal/debugger/inspect_probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ class ProbeInspectorSession {

async callCdp(method, params, probe = null) {
if (this.finished) { throw kInspectorFailedSentinel; }
this.inFlight = { __proto__: null, method, probe };
const request = { __proto__: null, method, probe };
this.inFlight = request;
debug('CDP -> %s%s', method, probe !== null ? `, probe=${probe.index}` : '');
try {
const result = await this.client.callMethod(method, params);
Expand Down Expand Up @@ -763,7 +764,9 @@ class ProbeInspectorSession {
}
throw kInspectorFailedSentinel;
} finally {
this.inFlight = null;
if (this.inFlight === request) {
this.inFlight = null;
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-debugger-probe-failure-process-exit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This tests that a clean process.exit(0) from inside a probe expression
// surfaces as probe_failure, not probe_target_exit.
// This tests end-to-end that a clean process.exit(0) from inside a probe
// expression remains attributed to that probe and surfaces as probe_failure,
// not probe_target_exit.
'use strict';

const common = require('../common');
Expand Down
Loading