File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -132,21 +132,24 @@ int NodeMainInstance::Run(const EnvSerializeInfo* env_info) {
132
132
int exit_code = 0 ;
133
133
DeleteFnPtr<Environment, FreeEnvironment> env =
134
134
CreateMainEnvironment (&exit_code, env_info);
135
-
136
135
CHECK_NOT_NULL (env);
137
- {
138
- Context::Scope context_scope (env->context ());
139
136
140
- if (exit_code == 0 ) {
141
- LoadEnvironment (env.get (), StartExecutionCallback{});
137
+ Context::Scope context_scope (env->context ());
138
+ Run (&exit_code, env.get ());
139
+ return exit_code;
140
+ }
142
141
143
- exit_code = SpinEventLoop (env.get ()).FromMaybe (1 );
144
- }
142
+ void NodeMainInstance::Run (int * exit_code, Environment* env) {
143
+ if (*exit_code == 0 ) {
144
+ LoadEnvironment (env, StartExecutionCallback{});
145
145
146
- ResetStdio ();
146
+ *exit_code = SpinEventLoop (env).FromMaybe (1 );
147
+ }
147
148
148
- // TODO(addaleax): Neither NODE_SHARED_MODE nor HAVE_INSPECTOR really
149
- // make sense here.
149
+ ResetStdio ();
150
+
151
+ // TODO(addaleax): Neither NODE_SHARED_MODE nor HAVE_INSPECTOR really
152
+ // make sense here.
150
153
#if HAVE_INSPECTOR && defined(__POSIX__) && !defined(NODE_SHARED_MODE)
151
154
struct sigaction act;
152
155
memset (&act, 0 , sizeof (act));
@@ -161,9 +164,6 @@ int NodeMainInstance::Run(const EnvSerializeInfo* env_info) {
161
164
#if defined(LEAK_SANITIZER)
162
165
__lsan_do_leak_check ();
163
166
#endif
164
- }
165
-
166
- return exit_code;
167
167
}
168
168
169
169
DeleteFnPtr<Environment, FreeEnvironment>
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ class NodeMainInstance {
59
59
60
60
// Start running the Node.js instances, return the exit code when finished.
61
61
int Run (const EnvSerializeInfo* env_info);
62
+ void Run (int * exit_code, Environment* env);
62
63
63
64
IsolateData* isolate_data () { return isolate_data_.get (); }
64
65
You can’t perform that action at this time.
0 commit comments