Skip to content

automatic argv does not work as intended from es6 #18

@shadowspawn

Description

@shadowspawn

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"!)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions