node/lib/internal/main
Joyee Cheung c7c566023f
module: reduce circular dependency of internal/modules/cjs/loader
Previously `internal/bootstrap/pre_execution.js` requires
`internal/modules/cjs/loader.js` which in turn requires
`internal/bootstrap/pre_execution.js`. This patch moves the
entry point execution logic out of `pre_execution.js` and
puts it into `internal/modules/run_main.js`. It also tests
that `Module.runMain` can be monkey-patched before further
deprecation/refactoring can be done.

Also added an internal assertion `hasLoadedAnyUserCJSModule`
for documentation purposes.

PR-URL: https://github.com/nodejs/node/pull/30349
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-11-19 14:46:07 +01:00
..
.eslintrc.yaml
check_syntax.js esm: unflag --experimental-modules 2019-11-17 00:39:55 -08:00
eval_stdin.js lib: use getOptionValue instead of process underscore aliases 2019-04-20 00:20:37 +08:00
eval_string.js lib: use getOptionValue instead of process underscore aliases 2019-04-20 00:20:37 +08:00
inspect.js process: call prepareMainThreadExecution in node inspect 2019-03-08 13:53:48 +01:00
print_bash_completion.js process: call prepareMainThreadExecution in all main thread scripts 2019-03-08 13:57:36 +01:00
print_help.js doc: add line for inspect host:port invocation 2019-07-11 20:40:08 -07:00
prof_process.js process: call prepareMainThreadExecution in all main thread scripts 2019-03-08 13:57:36 +01:00
repl.js repl: check for NODE_REPL_EXTERNAL_MODULE 2019-10-11 12:33:40 -07:00
run_main_module.js module: reduce circular dependency of internal/modules/cjs/loader 2019-11-19 14:46:07 +01:00
run_third_party_main.js lib: run prepareMainThreadExecution for third_party_main 2019-03-19 05:45:21 +01:00
worker_thread.js module: reduce circular dependency of internal/modules/cjs/loader 2019-11-19 14:46:07 +01:00