MCPcopy Index your code
hub / github.com/nodejs/node / setupProcessObject

Function setupProcessObject

lib/internal/bootstrap/node.js:418–446  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

416}
417
418function 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
448function setupGlobalProxy() {
449 ObjectDefineProperty(globalThis, SymbolToStringTag, {

Callers 1

node.jsFile · 0.85

Calls 1

requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…