-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
process: correctly parse Unicode in NODE_OPTIONS
Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed correctly. Fixes: #34399 PR-URL: #34476 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
- Loading branch information
Showing
2 changed files
with
40 additions
and
2 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
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,26 @@ | ||
'use strict'; | ||
// Flags: --expose-internals | ||
require('../common'); | ||
const { getOptionValue } = require('internal/options'); | ||
const assert = require('assert'); | ||
const cp = require('child_process'); | ||
|
||
const expected_redirect_value = 'foó'; | ||
|
||
if (process.argv.length === 2) { | ||
const NODE_OPTIONS = `--redirect-warnings=${expected_redirect_value}`; | ||
const result = cp.spawnSync(process.argv0, | ||
['--expose-internals', __filename, 'test'], | ||
{ | ||
env: { | ||
...process.env, | ||
NODE_OPTIONS | ||
}, | ||
stdio: 'inherit' | ||
}); | ||
assert.strictEqual(result.status, 0); | ||
} else { | ||
const redirect_value = getOptionValue('--redirect-warnings'); | ||
console.log(`--redirect-warings=${redirect_value}`); | ||
assert.strictEqual(redirect_value, expected_redirect_value); | ||
} |