process: make Symbol.toStringTag writable
The ecosystem broke by making it non-writable, so this is a good intermediate fix. PR-URL: https://github.com/nodejs/node/pull/26488 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
f77555f792
commit
2a7da11ed8
@ -283,7 +283,7 @@ function setupProcessObject() {
|
|||||||
EventEmitter.call(process);
|
EventEmitter.call(process);
|
||||||
Object.defineProperty(process, Symbol.toStringTag, {
|
Object.defineProperty(process, Symbol.toStringTag, {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
writable: false,
|
writable: true,
|
||||||
configurable: false,
|
configurable: false,
|
||||||
value: 'process'
|
value: 'process'
|
||||||
});
|
});
|
||||||
|
@ -4,3 +4,4 @@ import assert from 'assert';
|
|||||||
import process from 'process';
|
import process from 'process';
|
||||||
|
|
||||||
assert.strictEqual(Object.prototype.toString.call(process), '[object process]');
|
assert.strictEqual(Object.prototype.toString.call(process), '[object process]');
|
||||||
|
assert(Object.getOwnPropertyDescriptor(process, Symbol.toStringTag).writable);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user