inspector,cli: restore --debug and --inspect --debug-brk with deprecation warnings by refack · Pull Request #12949 · nodejs/node (original) (raw)

The main point was to make --inspect --debug-brk work again and emit a deprecation warning (while also making lone --debug and --debug-brk invalid):

if (process._invalidDebug) { process.emitWarning( 'node --debug and node --debug-brk are invalid. ' + 'Please use node --inspect or node --inspect-brk instead.', 'DeprecationWarning', 'DEP0062', startup, true); process.exit(9); } else if (process._deprecatedDebugBrk) { process.emitWarning( 'node --inspect --debug-brk is deprecated. ' + 'Please use node --inspect-brk instead.', 'DeprecationWarning', 'DEP0062', startup, true); }

Add --debug-brk and --debug back in as an undocumented and deprecated option
until 7.x is no longer supported.

Is that still accurate? 7.x is no longer supported, so if this was a temporary measure to make 8.x and 7.x be more compatible, maybe it doesn't apply to 6.x, and can now be reversed on 8.x? Or on 9.x?

I'm not sure it's accurate, well at least it's only part of the motivation. The other part is that 3rd party tooling depend on the --inspect --debug-brk combo, so IMHO we need to wait at least a year (an arbitrary measure of tools' version lifespan).
Also we declared the combo "valid but deprecated" so it needs to stay within the v8.x line.


As for backporting to v6.x, there the use of any --inspect* argument emits an experimental warning. IMHO that is no longer true, and should be removed and probably replaced with a deprecation warning for --debug*. Anyway emitting both for the --inspect --debug-break combo does not make sense.