node/lib/internal/modules
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
..
cjs module: reduce circular dependency of internal/modules/cjs/loader 2019-11-19 14:46:07 +01:00
esm esm: disable non-js exts outside package scopes 2019-11-17 00:40:00 -08:00
run_main.js module: reduce circular dependency of internal/modules/cjs/loader 2019-11-19 14:46:07 +01:00