mirror of
https://github.com/nodejs/node.git
synced 2025-05-10 14:09:34 +00:00

Delay the creation of process properties that depend on runtime states and properties that should not be accessed during bootstrap and patch them during pre-execution: - process.argv - process.execPath - process.title - process.pid - process.ppid - process.REVERT_* - process.debugPort PR-URL: https://github.com/nodejs/node/pull/26945 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
18 lines
481 B
JavaScript
18 lines
481 B
JavaScript
'use strict';
|
|
|
|
const {
|
|
prepareMainThreadExecution
|
|
} = require('internal/bootstrap/pre_execution');
|
|
|
|
prepareMainThreadExecution(true);
|
|
|
|
const CJSModule = require('internal/modules/cjs/loader');
|
|
|
|
markBootstrapComplete();
|
|
|
|
// Note: this actually tries to run the module as a ESM first if
|
|
// --experimental-modules is on.
|
|
// TODO(joyeecheung): can we move that logic to here? Note that this
|
|
// is an undocumented method available via `require('module').runMain`
|
|
CJSModule.runMain();
|