mirror of
https://github.com/nodejs/node.git
synced 2025-05-10 03:12:57 +00:00

PR-URL: https://github.com/nodejs/node/pull/46881 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
24 lines
793 B
JavaScript
24 lines
793 B
JavaScript
'use strict';
|
|
|
|
const { RegExpPrototypeExec } = primordials;
|
|
|
|
const {
|
|
prepareMainThreadExecution,
|
|
markBootstrapComplete,
|
|
} = require('internal/process/pre_execution');
|
|
|
|
prepareMainThreadExecution(true);
|
|
|
|
markBootstrapComplete();
|
|
|
|
// Necessary to reset RegExp statics before user code runs.
|
|
RegExpPrototypeExec(/^/, '');
|
|
|
|
// Note: this loads the module through the ESM loader if the module is
|
|
// determined to be an ES module. This hangs from the CJS module loader
|
|
// because we currently allow monkey-patching of the module loaders
|
|
// in the preloaded scripts through require('module').
|
|
// runMain here might be monkey-patched by users in --require.
|
|
// XXX: the monkey-patchability here should probably be deprecated.
|
|
require('internal/modules/cjs/loader').Module.runMain(process.argv[1]);
|