Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a85ce88

Browse filesBrowse files
committed
src: remove deprecated node debug command
The `node debug` command has been deprecated for a while now. There's really no good reason to keep it around. Move to end of life. PR-URL: #33648 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
1 parent 1904e73 commit a85ce88
Copy full SHA for a85ce88

File tree

Expand file treeCollapse file tree

5 files changed

+14
-73
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+14
-73
lines changed
Open diff view settings
Collapse file

‎doc/api/deprecations.md‎

Copy file name to clipboardExpand all lines: doc/api/deprecations.md
+4-1Lines changed: 4 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1435,12 +1435,15 @@ an officially supported API.
14351435
### DEP0068: `node debug`
14361436
<!-- YAML
14371437
changes:
1438+
- version: REPLACEME
1439+
pr-url: https://github.com/nodejs/node/pull/33648
1440+
description: The legacy `node debug` command was removed.
14381441
- version: v8.0.0
14391442
pr-url: https://github.com/nodejs/node/pull/11441
14401443
description: Runtime deprecation.
14411444
-->
14421445

1443-
Type: Runtime
1446+
Type: End-of-life
14441447

14451448
`node debug` corresponds to the legacy CLI debugger which has been replaced with
14461449
a V8-inspector based CLI debugger available through `node inspect`.
Collapse file

‎lib/internal/main/inspect.js‎

Copy file name to clipboardExpand all lines: lib/internal/main/inspect.js
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ const {
88

99
prepareMainThreadExecution();
1010

11-
if (process.argv[1] === 'debug') {
12-
process.emitWarning(
13-
'`node debug` is deprecated. Please use `node inspect` instead.',
14-
'DeprecationWarning', 'DEP0068');
15-
}
1611

1712
markBootstrapComplete();
1813

Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
477477
first_argv = env->argv()[1];
478478
}
479479

480-
if (first_argv == "inspect" || first_argv == "debug") {
480+
if (first_argv == "inspect") {
481481
return StartExecution(env, "internal/main/inspect");
482482
}
483483

Collapse file

‎test/parallel/test-debug-usage.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-debug-usage.js
-29Lines changed: 0 additions & 29 deletions
This file was deleted.
Collapse file

‎test/parallel/test-debugger-pid.js‎

Copy file name to clipboard
+9-37Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,28 @@
11
'use strict';
22
const common = require('../common');
33
common.skipIfInspectorDisabled();
4+
5+
if (common.isWindows)
6+
common.skip('unsupported function on windows');
7+
48
const assert = require('assert');
59
const spawn = require('child_process').spawn;
610

711
let buffer = '';
812

913
// Connect to debug agent
10-
const interfacer = spawn(process.execPath, ['debug', '-p', '655555']);
14+
const interfacer = spawn(process.execPath, ['inspect', '-p', '655555']);
1115

1216
interfacer.stdout.setEncoding('utf-8');
1317
interfacer.stderr.setEncoding('utf-8');
1418
const onData = (data) => {
1519
data = (buffer + data).split('\n');
1620
buffer = data.pop();
17-
data.forEach(function(line) {
18-
interfacer.emit('line', line);
19-
});
21+
data.forEach((line) => interfacer.emit('line', line));
2022
};
2123
interfacer.stdout.on('data', onData);
2224
interfacer.stderr.on('data', onData);
2325

24-
let lineCount = 0;
25-
interfacer.on('line', function(line) {
26-
let expected;
27-
const pid = interfacer.pid;
28-
switch (++lineCount) {
29-
case 1:
30-
expected =
31-
new RegExp(`^\\(node:${pid}\\) \\[DEP0068\\] DeprecationWarning: `);
32-
assert.match(line, expected);
33-
break;
34-
case 2:
35-
assert.match(line, /Use `node --trace-deprecation \.\.\.` to show where /);
36-
break;
37-
case 3:
38-
// Doesn't currently work on Windows.
39-
if (!common.isWindows) {
40-
expected = "Target process: 655555 doesn't exist.";
41-
assert.strictEqual(line, expected);
42-
}
43-
break;
44-
45-
default:
46-
if (!common.isWindows)
47-
assert.fail(`unexpected line received: ${line}`);
48-
}
49-
});
50-
51-
interfacer.on('exit', function(code, signal) {
52-
assert.strictEqual(code, 1, `Got unexpected code: ${code}`);
53-
if (!common.isWindows) {
54-
assert.strictEqual(lineCount, 3);
55-
}
56-
});
26+
interfacer.on('line', common.mustCall((line) => {
27+
assert.strictEqual(line, 'Target process: 655555 doesn\'t exist.');
28+
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.