mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
e6a7300a10
Disallow the use of Object.defineProperty() to hide entries in process.env or make them immutable. PR-URL: https://github.com/nodejs/node/pull/28006 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
14 lines
361 B
JavaScript
14 lines
361 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
process.env.foo = 'foo';
|
|
assert.strictEqual(process.env.foo, 'foo');
|
|
process.env.foo = undefined;
|
|
assert.strictEqual(process.env.foo, 'undefined');
|
|
|
|
process.env.foo = 'foo';
|
|
assert.strictEqual(process.env.foo, 'foo');
|
|
delete process.env.foo;
|
|
assert.strictEqual(process.env.foo, undefined);
|