mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
7b8058a39e
This patch refactors the branches for choosing the mode to run Node.js in `internal/bootstrap/node.js`. Instead of inlining the decision making all in `startup`, we create a `startExecution()` function which either detects and start the non-user-code mode, or prepares for user code execution (worker setup, preloading modules) and starts user code execution. We use early returns when we decide the mode to run Node.js in for fewer indentations and better readability. This patch also adds a few comments about the command-line switches and a few TODOs to remove underscore properties on `process` that are mainly used for bootstrap mode branching. It also includes a few other refactoring such as inlining functions/variables that are not reused and removing the default argument of `evalScript` for better clarity. PR-URL: https://github.com/nodejs/node/pull/24673 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
23 lines
1.1 KiB
Plaintext
23 lines
1.1 KiB
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 tryModuleLoad (internal/modules/cjs/loader.js:*:*)
|
|
at Function.Module._load (internal/modules/cjs/loader.js:*:*)
|
|
at Function.Module.runMain (internal/modules/cjs/loader.js:*:*)
|
|
at executeUserCode (internal/bootstrap/node.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 executeUserCode (internal/bootstrap/node.js:*:*)
|
|
at startExecution (internal/bootstrap/node.js:*:*)
|