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: moving f function call comment #8405

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/node.cc
Expand Up @@ -3388,14 +3388,6 @@ void LoadEnvironment(Environment* env) {
CHECK(f_value->IsFunction());
Local<Function> f = Local<Function>::Cast(f_value);

// Now we call 'f' with the 'process' variable that we've built up with
// all our bindings. Inside bootstrap_node.js we'll take care of
// assigning things to their places.

// We start the process this way in order to be more modular. Developers
// who do not like how bootstrap_node.js setups the module system but do
// like Node's I/O bindings may want to replace 'f' with their own function.

// Add a reference to the global object
Local<Object> global = env->context()->Global();

Expand Down Expand Up @@ -3425,6 +3417,13 @@ void LoadEnvironment(Environment* env) {
// (Allows you to set stuff on `global` from anywhere in JavaScript.)
global->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "global"), global);

// Now we call 'f' with the 'process' variable that we've built up with
// all our bindings. Inside bootstrap_node.js we'll take care of
// assigning things to their places.

// We start the process this way in order to be more modular. Developers
// who do not like how bootstrap_node.js setups the module system but do
// like Node's I/O bindings may want to replace 'f' with their own function.
Local<Value> arg = env->process_object();
f->Call(Null(env->isolate()), 1, &arg);
}
Expand Down