Skip to content

Commit 030b744

Browse files
guybedfordBridgeAR
authored andcommitted
esm: process proxy Symbol.toString fix
PR-URL: #25963 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent cb2cbf2 commit 030b744

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/internal/bootstrap/node.js

+6
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ function setupProcessObject() {
347347
const origProcProto = Object.getPrototypeOf(process);
348348
Object.setPrototypeOf(origProcProto, EventEmitter.prototype);
349349
EventEmitter.call(process);
350+
Object.defineProperty(process, Symbol.toStringTag, {
351+
enumerable: false,
352+
writable: false,
353+
configurable: false,
354+
value: 'process'
355+
});
350356
// Make process globally available to users by putting it on the global proxy
351357
global.process = process;
352358
}

test/es-module/test-esm-process.mjs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Flags: --experimental-modules
2+
import '../common';
3+
import assert from 'assert';
4+
import process from 'process';
5+
6+
assert.strictEqual(Object.prototype.toString.call(process), '[object process]');

0 commit comments

Comments
 (0)