mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
This patch reduce usage of `process._breakFirstLine` and
`process._eval` in the internals and use
`getOptionValue('--inspect-brk')` and `getOptionValue('--eval')`
instead wherever possible.
PR-URL: https://github.com/nodejs/node/pull/27278
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
27 lines
760 B
JavaScript
27 lines
760 B
JavaScript
'use strict';
|
|
|
|
// User passed `-e` or `--eval` arguments to Node without `-i` or
|
|
// `--interactive`.
|
|
|
|
const {
|
|
prepareMainThreadExecution
|
|
} = require('internal/bootstrap/pre_execution');
|
|
const { evalModule, evalScript } = require('internal/process/execution');
|
|
const { addBuiltinLibsToObject } = require('internal/modules/cjs/helpers');
|
|
|
|
const { getOptionValue } = require('internal/options');
|
|
|
|
prepareMainThreadExecution();
|
|
addBuiltinLibsToObject(global);
|
|
markBootstrapComplete();
|
|
|
|
const source = getOptionValue('--eval');
|
|
const print = getOptionValue('--print');
|
|
if (getOptionValue('--input-type') === 'module')
|
|
evalModule(source, print);
|
|
else
|
|
evalScript('[eval]',
|
|
source,
|
|
getOptionValue('--inspect-brk'),
|
|
print);
|