fix: place _babel-node after process.execArgv (#12638)

Workaround https://github.com/nodejs/node/issues/36948
This commit is contained in:
Huáng Jùnliàng 2021-01-18 15:15:03 -05:00 committed by GitHub
parent bc39a081f5
commit 6e8250a3a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -196,7 +196,7 @@ if (program.eval || program.print) {
// add back on node and concat the sliced args
process.argv = ["node"].concat(args);
process.execArgv.unshift(__filename);
process.execArgv.push(__filename);
Module.runMain();
} else {

View File

@ -0,0 +1,7 @@
const cluster = require("cluster");
console.log(typeof global.gc, cluster.isMaster);
if (cluster.isMaster) {
cluster.fork();
} else {
process.kill(process.pid);
}

View File

@ -0,0 +1,4 @@
{
"args": ["--expose_gc", "payload.js"],
"stdout": "function true\nfunction false"
}