Skip to content

Commit cf1117a

Browse files
refacktargos
authored andcommitted
process: move deprecation warning setup for --debug* args
PR-URL: #26662 Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 4200fc3 commit cf1117a

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/internal/bootstrap/node.js

-14
Original file line numberDiff line numberDiff line change
@@ -219,20 +219,6 @@ Object.defineProperty(process, 'argv0', {
219219
});
220220
process.argv[0] = process.execPath;
221221

222-
// Handle `--debug*` deprecation and invalidation.
223-
if (process._invalidDebug) {
224-
process.emitWarning(
225-
'`node --debug` and `node --debug-brk` are invalid. ' +
226-
'Please use `node --inspect` or `node --inspect-brk` instead.',
227-
'DeprecationWarning', 'DEP0062', undefined, true);
228-
process.exit(9);
229-
} else if (process._deprecatedDebugBrk) {
230-
process.emitWarning(
231-
'`node --inspect --debug-brk` is deprecated. ' +
232-
'Please use `node --inspect-brk` instead.',
233-
'DeprecationWarning', 'DEP0062', undefined, true);
234-
}
235-
236222
// TODO(jasnell): The following have been globals since around 2012.
237223
// That's just silly. The underlying perfctr support has been removed
238224
// so these are now deprecated non-ops that can be removed after one

lib/internal/bootstrap/pre_execution.js

+14
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ function prepareMainThreadExecution() {
1818
setupCoverageHooks(process.env.NODE_V8_COVERAGE);
1919
}
2020

21+
// Handle `--debug*` deprecation and invalidation.
22+
if (process._invalidDebug) {
23+
process.emitWarning(
24+
'`node --debug` and `node --debug-brk` are invalid. ' +
25+
'Please use `node --inspect` or `node --inspect-brk` instead.',
26+
'DeprecationWarning', 'DEP0062', undefined, true);
27+
process.exit(9);
28+
} else if (process._deprecatedDebugBrk) {
29+
process.emitWarning(
30+
'`node --inspect --debug-brk` is deprecated. ' +
31+
'Please use `node --inspect-brk` instead.',
32+
'DeprecationWarning', 'DEP0062', undefined, true);
33+
}
34+
2135
// Only main thread receives signals.
2236
setupSignalHandlers();
2337

0 commit comments

Comments
 (0)