Please sign in to comment.
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: #24961 PR-URL: #25127 Reviewed-By: Anna Henningsen <firstname.lastname@example.org> Reviewed-By: James M Snell <email@example.com> Backport-PR-URL: #25496
- Loading branch information...
Showing with 322 additions and 317 deletions.
- +77 −23 lib/internal/bootstrap/node.js
- +14 −10 lib/internal/process/main_thread_only.js
- +56 −85 lib/internal/process/per_thread.js
- +0 −14 src/bootstrapper.cc
- +1 −154 src/node.cc
- +1 −0 src/node_binding.cc
- +1 −14 src/node_internals.h
- +171 −16 src/node_process.cc
- +1 −1 test/parallel/test-bootstrap-modules.js
Oops, something went wrong.