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

src: move more process methods initialization in bootstrap/node.js #25127

Closed
wants to merge 1 commit into from

Commits on Dec 20, 2018

  1. src: move more process methods initialization in bootstrap/node.js

    Instead of:
    
    - Writing methods onto the process directly in C++ during
      `SetupProcessObject()` and overwrite with argument checks later
    - Or, wrapping and writing them in `internal/process/*.js`
    
    Do:
    
    - Move the C++ implementations in node_process.cc and mark them static
      wherever possible
    - Expose the C++ methods through a new
      `internalBinding('process_methods')`
    - Wrap the methods in `internal/process/*.js` in a
      side-effect-free manner and return them back to
      `internal/bootstrap/node.js`
    - Centralize the write to the process object based on conditions
      in `bootstrap/node.js`
    
    So it's easier to see what methods are attached to the process object
    during bootstrap under what condition and in what order.
    
    The eventual goal is to figure out the dependency of process methods
    and the write/read access to the process object during bootstrap, group
    these access properly and remove the process properties that should not
    be exposed to users this way.
    
    Also correct the NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE milestone
    which should be marked before code execution.
    
    Refs: nodejs#24961
    joyeecheung committed Dec 20, 2018
    Configuration menu
    Copy the full SHA
    7108077 View commit details
    Browse the repository at this point in the history