| 416 | } |
| 417 | |
| 418 | function setupProcessObject() { |
| 419 | const EventEmitter = require('events'); |
| 420 | const origProcProto = ObjectGetPrototypeOf(process); |
| 421 | ObjectSetPrototypeOf(origProcProto, EventEmitter.prototype); |
| 422 | FunctionPrototypeCall(EventEmitter, process); |
| 423 | ObjectDefineProperty(process, SymbolToStringTag, { |
| 424 | __proto__: null, |
| 425 | enumerable: false, |
| 426 | writable: true, |
| 427 | configurable: false, |
| 428 | value: 'process', |
| 429 | }); |
| 430 | |
| 431 | // Create global.process as getters so that we have a |
| 432 | // deprecation path for these in ES Modules. |
| 433 | // See https://github.com/nodejs/node/pull/26334. |
| 434 | let _process = process; |
| 435 | ObjectDefineProperty(globalThis, 'process', { |
| 436 | __proto__: null, |
| 437 | get() { |
| 438 | return _process; |
| 439 | }, |
| 440 | set(value) { |
| 441 | _process = value; |
| 442 | }, |
| 443 | enumerable: false, |
| 444 | configurable: true, |
| 445 | }); |
| 446 | } |
| 447 | |
| 448 | function setupGlobalProxy() { |
| 449 | ObjectDefineProperty(globalThis, SymbolToStringTag, { |