summaryrefslogtreecommitdiff
path: root/src/node_util.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-11-27 21:36:22 +0800
committerRich Trott <rtrott@gmail.com>2018-11-29 12:55:56 -0800
commit7b8058a39e3485f7c6aeab87e9953f30c9974afd (patch)
tree249461ba38fefbc78d69c48fa31e566a6b4c415a /src/node_util.cc
parent5dacbf594ef80f8eadea274f537cc17cc1e5ebe1 (diff)
downloadandroid-node-v8-7b8058a39e3485f7c6aeab87e9953f30c9974afd.tar.gz
android-node-v8-7b8058a39e3485f7c6aeab87e9953f30c9974afd.tar.bz2
android-node-v8-7b8058a39e3485f7c6aeab87e9953f30c9974afd.zip
process: refactor the bootstrap mode branching for readability
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>
Diffstat (limited to 'src/node_util.cc')
0 files changed, 0 insertions, 0 deletions