-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
5 changed files
with
14 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,28 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
common.skipIfInspectorDisabled(); | ||
|
||
if (common.isWindows) | ||
common.skip('unsupported function on windows'); | ||
|
||
const assert = require('assert'); | ||
const spawn = require('child_process').spawn; | ||
|
||
let buffer = ''; | ||
|
||
// Connect to debug agent | ||
const interfacer = spawn(process.execPath, ['debug', '-p', '655555']); | ||
const interfacer = spawn(process.execPath, ['inspect', '-p', '655555']); | ||
|
||
interfacer.stdout.setEncoding('utf-8'); | ||
interfacer.stderr.setEncoding('utf-8'); | ||
const onData = (data) => { | ||
data = (buffer + data).split('\n'); | ||
buffer = data.pop(); | ||
data.forEach(function(line) { | ||
interfacer.emit('line', line); | ||
}); | ||
data.forEach((line) => interfacer.emit('line', line)); | ||
}; | ||
interfacer.stdout.on('data', onData); | ||
interfacer.stderr.on('data', onData); | ||
|
||
let lineCount = 0; | ||
interfacer.on('line', function(line) { | ||
let expected; | ||
const pid = interfacer.pid; | ||
switch (++lineCount) { | ||
case 1: | ||
expected = | ||
new RegExp(`^\\(node:${pid}\\) \\[DEP0068\\] DeprecationWarning: `); | ||
assert.match(line, expected); | ||
break; | ||
case 2: | ||
assert.match(line, /Use `node --trace-deprecation \.\.\.` to show where /); | ||
break; | ||
case 3: | ||
// Doesn't currently work on Windows. | ||
if (!common.isWindows) { | ||
expected = "Target process: 655555 doesn't exist."; | ||
assert.strictEqual(line, expected); | ||
} | ||
break; | ||
|
||
default: | ||
if (!common.isWindows) | ||
assert.fail(`unexpected line received: ${line}`); | ||
} | ||
}); | ||
|
||
interfacer.on('exit', function(code, signal) { | ||
assert.strictEqual(code, 1, `Got unexpected code: ${code}`); | ||
if (!common.isWindows) { | ||
assert.strictEqual(lineCount, 3); | ||
} | ||
}); | ||
interfacer.on('line', common.mustCall((line) => { | ||
assert.strictEqual(line, 'Target process: 655555 doesn\'t exist.'); | ||
})); |