process: handle node --debug deprecation in pre-execution · nodejs/node@be3ea2a (original) (raw)
`@@ -165,6 +165,23 @@ function initializeDeprecations() {
`
165
165
`const { deprecate } = require('internal/util');
`
166
166
`const pendingDeprecation = getOptionValue('--pending-deprecation');
`
167
167
``
``
168
`` +
// Handle --debug*
deprecation and invalidation.
``
``
169
`+
if (getOptionValue('--debug')) {
`
``
170
`+
if (!getOptionValue('--inspect')) {
`
``
171
`+
process.emitWarning(
`
``
172
`` +
'node --debug
and node --debug-brk
are invalid. ' +
``
``
173
`` +
'Please use node --inspect
or node --inspect-brk
instead.',
``
``
174
`+
'DeprecationWarning', 'DEP0062', undefined, true);
`
``
175
`+
process.exit(9);
`
``
176
`+
} else if (getOptionValue('--inspect-brk')) {
`
``
177
`+
process._deprecatedDebugBrk = true;
`
``
178
`+
process.emitWarning(
`
``
179
`` +
'node --inspect --debug-brk
is deprecated. ' +
``
``
180
`` +
'Please use node --inspect-brk
instead.',
``
``
181
`+
'DeprecationWarning', 'DEP0062', undefined, true);
`
``
182
`+
}
`
``
183
`+
}
`
``
184
+
168
185
`` // DEP0103: access to process.binding('util').isX
type checkers
``
169
186
`// TODO(addaleax): Turn into a full runtime deprecation.
`
170
187
`const utilBinding = internalBinding('util');
`