| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3ae58ac commit 8bda7b8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -122,6 +122,17 @@ child.exec(`${nodejs} --use-strict -p process.execArgv`, | |||
| 122 | 122 | assert.strictEqual(stdout, ''); | |
| 123 | 123 | assert.strictEqual(stderr, ''); | |
| 124 | 124 | })); | |
| 125 | + | ||
| 126 | + // Make sure that monkey-patching process.execArgv doesn't cause child_process | ||
| 127 | + // to incorrectly munge execArgv. | ||
| 128 | + child.exec( | ||
| 129 | + `${nodejs} -e "process.execArgv = ['-e', 'console.log(42)', 'thirdArg'];` + | ||
| 130 | + `require('child_process').fork('${emptyFile}')"`, | ||
| 131 | + common.mustCall((err, stdout, stderr) => { | ||
| 132 | + assert.ifError(err); | ||
| 133 | + assert.strictEqual(stdout, '42\n'); | ||
| 134 | + assert.strictEqual(stderr, ''); | ||
| 135 | + })); | ||
| 125 | 136 | } | |
| 126 | 137 | ||
| 127 | 138 | // Regression test for https://github.com/nodejs/node/issues/8534. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments