Skip to content

Commit

Permalink
catch up with main
Browse files Browse the repository at this point in the history
  • Loading branch information
Momtchil Momtchev committed Aug 31, 2022
1 parent e198308 commit db147f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/internal/bootstrap/switches/is_embedded_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Set up globalThis.require and globalThis.import so that they can
// be easily accessed from C/C++

/* global path, primordials */
/* global path, primordials, process, GetLinkedBinding, GetInternalBinding */

const { globalThis, ObjectCreate } = primordials;
const CJSLoader = require('internal/modules/cjs/loader');
Expand Down
18 changes: 9 additions & 9 deletions src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -903,16 +903,16 @@ napi_status NAPI_CDECL napi_create_environment(napi_platform platform,
auto path = v8::String::NewFromUtf8(emb_env->setup()->isolate(),
env->exec_path().c_str())
.ToLocalChecked();
std::vector<v8::Local<v8::String>> params = {env->primordials_string(),
env->process_string(),
env->require_string(),
env->path_string()};
std::vector<v8::Local<v8::Value>> args = {env->primordials(),
env->process_object(),
env->native_module_require(),
path};

std::vector<v8::Local<v8::Value>> bootstrap_args = {
env->process_object(),
env->builtin_module_require(),
env->internal_binding_loader(),
env->primordials(),
path};

auto ret = node::ExecuteBootstrapper(
env, "internal/bootstrap/switches/is_embedded_env", &params, &args);
env, "internal/bootstrap/switches/is_embedded_env", &bootstrap_args);
if (ret.IsEmpty()) return napi_pending_exception;

ret = node::LoadEnvironment(env, main_script);
Expand Down
3 changes: 2 additions & 1 deletion src/node_builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,13 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompile(
} else if (strncmp(id,
"internal/bootstrap/",
strlen("internal/bootstrap/")) == 0) {
// internal/bootstrap/*: process, require, internalBinding, primordials
// internal/bootstrap/*: process, require, internalBinding, primordials, path
parameters = {
FIXED_ONE_BYTE_STRING(isolate, "process"),
FIXED_ONE_BYTE_STRING(isolate, "require"),
FIXED_ONE_BYTE_STRING(isolate, "internalBinding"),
FIXED_ONE_BYTE_STRING(isolate, "primordials"),
FIXED_ONE_BYTE_STRING(isolate, "path"),
};
} else {
// others: exports, require, module, process, internalBinding, primordials
Expand Down

0 comments on commit db147f3

Please sign in to comment.