mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
bf31d3c3b1
Fixes: https://github.com/nodejs/node/issues/36246 PR-URL: https://github.com/nodejs/node/pull/36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
23 lines
547 B
JavaScript
23 lines
547 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
// This checks that after accessing a missing env var, a subsequent
|
|
// env read will succeed even for empty variables.
|
|
|
|
{
|
|
process.env.FOO = '';
|
|
process.env.NONEXISTENT_ENV_VAR; // eslint-disable-line no-unused-expressions
|
|
const foo = process.env.FOO;
|
|
|
|
assert.strictEqual(foo, '');
|
|
}
|
|
|
|
{
|
|
process.env.FOO = '';
|
|
process.env.NONEXISTENT_ENV_VAR; // eslint-disable-line no-unused-expressions
|
|
const hasFoo = 'FOO' in process.env;
|
|
|
|
assert.strictEqual(hasFoo, true);
|
|
}
|