Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process: refactor the bootstrap mode branching for readability #24673

Closed
wants to merge 1 commit into from

Commits on Nov 29, 2018

  1. 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.
    joyeecheung committed Nov 29, 2018
    Configuration menu
    Copy the full SHA
    0a7f427 View commit details
    Browse the repository at this point in the history