mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 14:40:10 +00:00

In the 2017-04-05 meeting, the CTC agreed to remove support for the legacy debugger in 8.0.0. This is the first step in this direction. Refs: https://github.com/nodejs/CTC/issues/94 PR-URL: https://github.com/nodejs/node/pull/12197 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
'use strict';
|
|
// Flags: --inspect={PORT}
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
const assert = require('assert');
|
|
const cluster = require('cluster');
|
|
const debuggerPort = common.PORT;
|
|
|
|
if (cluster.isMaster) {
|
|
function checkExitCode(code, signal) {
|
|
assert.strictEqual(code, 0);
|
|
assert.strictEqual(signal, null);
|
|
}
|
|
|
|
function fork(offset, execArgv) {
|
|
if (execArgv)
|
|
cluster.setupMaster({execArgv});
|
|
|
|
const check = common.mustCall(checkExitCode);
|
|
cluster.fork({portSet: debuggerPort + offset}).on('exit', check);
|
|
}
|
|
|
|
assert.strictEqual(process.debugPort, debuggerPort);
|
|
|
|
fork(1);
|
|
fork(2, ['--inspect']);
|
|
fork(3, [`--inspect=${debuggerPort}`]);
|
|
fork(4, ['--inspect', `--debug-port=${debuggerPort}`]);
|
|
fork(5, [`--inspect-port=${debuggerPort}`]);
|
|
fork(6, ['--inspect', `--inspect-port=${debuggerPort}`]);
|
|
} else {
|
|
const hasDebugArg = process.execArgv.some(function(arg) {
|
|
return /inspect/.test(arg);
|
|
});
|
|
|
|
assert.strictEqual(hasDebugArg, true);
|
|
assert.strictEqual(process.debugPort, +process.env.portSet);
|
|
process.exit();
|
|
}
|