mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
efce655c0f
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>
21 lines
961 B
Plaintext
21 lines
961 B
Plaintext
events.js:*
|
|
throw er; // Unhandled 'error' event
|
|
^
|
|
|
|
Error: foo:bar
|
|
at bar (*events_unhandled_error_common_trace.js:*:*)
|
|
at foo (*events_unhandled_error_common_trace.js:*:*)
|
|
at Object.<anonymous> (*events_unhandled_error_common_trace.js:*:*)
|
|
at Module._compile (internal/modules/cjs/loader.js:*:*)
|
|
at Object.Module._extensions..js (internal/modules/cjs/loader.js:*:*)
|
|
at Module.load (internal/modules/cjs/loader.js:*:*)
|
|
at Function.Module._load (internal/modules/cjs/loader.js:*:*)
|
|
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:*:*)
|
|
at internal/main/run_main_module.js:*:*
|
|
Emitted 'error' event at:
|
|
at quux (*events_unhandled_error_common_trace.js:*:*)
|
|
at Object.<anonymous> (*events_unhandled_error_common_trace.js:*:*)
|
|
at Module._compile (internal/modules/cjs/loader.js:*:*)
|
|
[... lines matching original stack trace ...]
|
|
at internal/main/run_main_module.js:*:*
|