• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const { RegExpPrototypeExec } = primordials;
4
5const {
6  prepareMainThreadExecution,
7  markBootstrapComplete,
8} = require('internal/process/pre_execution');
9
10prepareMainThreadExecution(true);
11
12markBootstrapComplete();
13
14// Necessary to reset RegExp statics before user code runs.
15RegExpPrototypeExec(/^/, '');
16
17// Note: this loads the module through the ESM loader if the module is
18// determined to be an ES module. This hangs from the CJS module loader
19// because we currently allow monkey-patching of the module loaders
20// in the preloaded scripts through require('module').
21// runMain here might be monkey-patched by users in --require.
22// XXX: the monkey-patchability here should probably be deprecated.
23require('internal/modules/cjs/loader').Module.runMain(process.argv[1]);
24