-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
src: split LoadEnvironment() at startExecution()
#25320
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1085,6 +1085,14 @@ static MaybeLocal<Value> ExecuteBootstrapper( | |
| } | ||
|
|
||
| void LoadEnvironment(Environment* env) { | ||
| RunBootstrapping(env); | ||
| StartExecution(env); | ||
| } | ||
|
|
||
| void RunBootstrapping(Environment* env) { | ||
| CHECK(!env->has_run_bootstrapping_code()); | ||
| env->set_has_run_bootstrapping_code(true); | ||
|
|
||
| HandleScope handle_scope(env->isolate()); | ||
| Isolate* isolate = env->isolate(); | ||
| Local<Context> context = env->context(); | ||
|
|
@@ -1146,11 +1154,24 @@ void LoadEnvironment(Environment* env) { | |
| loader_exports.ToLocalChecked(), | ||
| Boolean::New(isolate, env->is_main_thread())}; | ||
|
|
||
| if (ExecuteBootstrapper( | ||
| Local<Value> start_execution; | ||
| if (!ExecuteBootstrapper( | ||
| env, "internal/bootstrap/node", &node_params, &node_args) | ||
| .IsEmpty()) { | ||
| .ToLocal(&start_execution)) { | ||
| return; | ||
| } | ||
|
|
||
| if (start_execution->IsFunction()) | ||
| env->set_start_execution_function(start_execution.As<Function>()); | ||
| } | ||
|
|
||
| void StartExecution(Environment* env) { | ||
| HandleScope handle_scope(env->isolate()); | ||
| Local<Function> start_execution = env->start_execution_function(); | ||
| if (start_execution.IsEmpty()) return; | ||
| start_execution->Call( | ||
| env->context(), Undefined(env->isolate()), 0, nullptr); | ||
| env->set_start_execution_function(Local<Function>()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe do this before the call to, er, Call() as an extra guard against recursive invocation?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, but it requires some extra magic because of the way the |
||
| } | ||
|
|
||
| static void StartInspector(Environment* env, const char* path) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,4 +18,3 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: | |
| at * | ||
| at * | ||
| at * | ||
| at * | ||
Uh oh!
There was an error while loading. Please reload this page.