(commandLineApi)
| 68 | |
| 69 | // Create a special require function for the inspector command line API |
| 70 | function installConsoleExtensions(commandLineApi) { |
| 71 | if (commandLineApi.require) { return; } |
| 72 | const { tryGetCwd } = require('internal/process/execution'); |
| 73 | const CJSModule = require('internal/modules/cjs/loader').Module; |
| 74 | const { makeRequireFunction } = require('internal/modules/helpers'); |
| 75 | const consoleAPIModule = new CJSModule('<inspector console>'); |
| 76 | const cwd = tryGetCwd(); |
| 77 | consoleAPIModule.paths = []; |
| 78 | ArrayPrototypePushApply(consoleAPIModule.paths, CJSModule._nodeModulePaths(cwd)); |
| 79 | ArrayPrototypePushApply(consoleAPIModule.paths, CJSModule.globalPaths); |
| 80 | commandLineApi.require = makeRequireFunction(consoleAPIModule); |
| 81 | } |
| 82 | |
| 83 | // Wrap a console implemented by Node.js with features from the VM inspector |
| 84 | function wrapConsole(consoleFromNode) { |
nothing calls this directly
no test coverage detected