process: allow modification of process.argv0
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
process
Description of Changes
When originally created, writable
was omitted from the definition of process.argv0
-- presumably because there seemed to be no explicit reason for making it writable. This choice prevents some things Node.js users, specially CLI tool authors (hi) might want to do. In my case, I'm trying to get npx to replace itself with a Node sub-command without spawning a new process, and that means I have to do some usually-ill-advised things.
I'd like to get a temperature check from y'all about this change. Holding back on spending a lot of time writing tests, changing docs, etc, until I get a sense of how acceptable it would be. I'll add those to this PR asap if this seems fine.
I also wonder whether or not something like this would be a breaking change -- I'd argue it's more of a feature, since it would've been an error to assign it, before. I'm also biased 'cause I'd love to get this backported ;)