-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* partitioning the subprocess groups * use `-e` instead of module * reduce maxBuffer PR-URL: #14195 Fixes: #14191 Reviewed-By: Rich Trott <rtrott@gmail.com>
- Loading branch information
1 parent
e87cb32
commit e3d0ff9
Showing
2 changed files
with
49 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
if (process.config.variables.node_without_node_options) | ||
common.skip('missing NODE_OPTIONS support'); | ||
|
||
// Test options specified by env variable. | ||
|
||
const assert = require('assert'); | ||
const exec = require('child_process').execFile; | ||
|
||
common.refreshTmpDir(); | ||
process.chdir(common.tmpDir); | ||
|
||
disallow('--version'); | ||
disallow('-v'); | ||
disallow('--help'); | ||
disallow('-h'); | ||
disallow('--eval'); | ||
disallow('-e'); | ||
disallow('--print'); | ||
disallow('-p'); | ||
disallow('-pe'); | ||
disallow('--check'); | ||
disallow('-c'); | ||
disallow('--interactive'); | ||
disallow('-i'); | ||
disallow('--v8-options'); | ||
disallow('--'); | ||
disallow('--no_warnings'); // Node options don't allow '_' instead of '-'. | ||
|
||
function disallow(opt) { | ||
const env = Object.assign({}, process.env, { NODE_OPTIONS: opt }); | ||
exec(process.execPath, { env }, common.mustCall(function(err) { | ||
const message = err.message.split(/\r?\n/)[1]; | ||
const expect = `${process.execPath}: ${opt} is not allowed in NODE_OPTIONS`; | ||
|
||
assert.strictEqual(err.code, 9); | ||
assert.strictEqual(message, expect); | ||
})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters