diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-03-19 19:12:23 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2019-04-03 03:46:03 +0300 |
commit | 19442656789a7edd327d453a16f699d4f5259a5c (patch) | |
tree | 78ae15e1b70df80d14b7306aea25d9d90973b7fe /src/api | |
parent | e02f511dccaf41f103403936359d43ce2ad86d1e (diff) |
process: run RunBootstrapping in CreateEnvironment
Also creates `CreateMainEnvironment` to encapsulate the code
creating the main environment from the provided Isolate data
and arguments.
PR-URL: https://github.com/nodejs/node/pull/26788
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/environment.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/api/environment.cc b/src/api/environment.cc index 2ecf4029909..62eca337e15 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -251,6 +251,23 @@ Environment* CreateEnvironment(IsolateData* isolate_data, Environment::kOwnsInspector)); env->InitializeLibuv(per_process::v8_is_profiling); env->ProcessCliArgs(args, exec_args); + if (RunBootstrapping(env).IsEmpty()) { + return nullptr; + } + + std::vector<Local<String>> parameters = { + env->require_string(), + FIXED_ONE_BYTE_STRING(env->isolate(), "markBootstrapComplete")}; + std::vector<Local<Value>> arguments = { + env->native_module_require(), + env->NewFunctionTemplate(MarkBootstrapComplete) + ->GetFunction(env->context()) + .ToLocalChecked()}; + if (ExecuteBootstrapper( + env, "internal/bootstrap/environment", ¶meters, &arguments) + .IsEmpty()) { + return nullptr; + } return env; } |