|
argv = process.argv.slice(require.main ? 2 : 1), |
I assume this line is intended to emulate the proposed process.mainArgs and get the slice right when called from the node REPL and/or with --eval.
However, when the script being executed is es6 (.mjs) then require.main is undefined and it slices incorrectly. Tested using node v16.13.0.
(I can refrain from posting bug reports if inappropriate for "early WIP"!)