mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
de565ad1b2
Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed correctly. Fixes: https://github.com/nodejs/node/issues/34399 PR-URL: https://github.com/nodejs/node/pull/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>
27 lines
978 B
JavaScript
27 lines
978 B
JavaScript
'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);
|
|
}
|