From d65615e119994ff071e90c19173d257fddfa962b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 8 Apr 2021 04:05:12 -0700 Subject: [PATCH] debugger: remove unused code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove code that was for when `node-inspect` was called as a standalone process. PR-URL: https://github.com/nodejs/node/pull/38161 Refs: https://github.com/nodejs/node/discussions/36481 Reviewed-By: Matteo Collina Reviewed-By: Jan Krems Reviewed-By: Colin Ihrig Reviewed-By: Stephen Belanger Reviewed-By: Gerhard Stöbich Reviewed-By: Michaël Zasso --- lib/internal/inspector/_inspect.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/internal/inspector/_inspect.js b/lib/internal/inspector/_inspect.js index df4e53979db8fd..8bc1f13e5726f0 100644 --- a/lib/internal/inspector/_inspect.js +++ b/lib/internal/inspector/_inspect.js @@ -29,16 +29,7 @@ const { EventEmitter } = require('events'); const net = require('net'); const util = require('util'); -const runAsStandalone = typeof __dirname !== 'undefined'; - const { 0: InspectClient, 1: createRepl } = - runAsStandalone ? - // This copy of node-inspect is on-disk, relative paths make sense. - [ - require('./inspect_client'), - require('./inspect_repl'), - ] : - // This copy of node-inspect is built into the node executable. [ require('internal/inspector/inspect_client'), require('internal/inspector/inspect_repl'), @@ -336,9 +327,7 @@ function startInspect(argv = process.argv.slice(2), stdin = process.stdin, stdout = process.stdout) { if (argv.length < 1) { - const invokedAs = runAsStandalone ? - 'node-inspect' : - `${process.argv0} ${process.argv[1]}`; + const invokedAs = `${process.argv0} ${process.argv[1]}`; console.error(`Usage: ${invokedAs} script.js`); console.error(` ${invokedAs} :`);