diff --git a/src/module_wrap.cc b/src/module_wrap.cc index d9711500f178c7..2dc4b2c37f37ba 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -113,9 +113,8 @@ ModuleCacheKey ModuleCacheKey::From(Local context, DCHECK(DataIsString(import_attributes->Get(context, i))); DCHECK(DataIsString(import_attributes->Get(context, i + 1))); - Local v8_key = import_attributes->Get(context, i).As(); - Local v8_value = - import_attributes->Get(context, i + 1).As(); + Local v8_key = import_attributes->Get(i).As(); + Local v8_value = import_attributes->Get(i + 1).As(); Utf8Value key_utf8(isolate, v8_key); Utf8Value value_utf8(isolate, v8_value); @@ -547,8 +546,8 @@ static Local createImportAttributesContainer( LocalVector values(isolate, num_attributes); for (int i = 0; i < raw_attributes->Length(); i += elements_per_attribute) { - Local key = raw_attributes->Get(realm->context(), i); - Local value = raw_attributes->Get(realm->context(), i + 1); + Local key = raw_attributes->Get(i); + Local value = raw_attributes->Get(i + 1); DCHECK(DataIsString(key)); DCHECK(DataIsString(value)); @@ -573,7 +572,7 @@ static Local createModuleRequestsContainer( for (int i = 0; i < raw_requests->Length(); i++) { DCHECK(raw_requests->Get(context, i)->IsModuleRequest()); Local module_request = - raw_requests->Get(realm->context(), i).As(); + raw_requests->Get(i).As(); Local specifier = module_request->GetSpecifier(); @@ -661,8 +660,8 @@ void ModuleWrap::Link(const FunctionCallbackInfo& args) { // TODO(joyeecheung): merge this with the serializeKey() in module_map.js. // This currently doesn't sort the import attributes. Local module_value = modules_vector[i].Get(isolate); - ModuleCacheKey module_cache_key = ModuleCacheKey::From( - context, requests->Get(context, i).As()); + ModuleCacheKey module_cache_key = + ModuleCacheKey::From(context, requests->Get(i).As()); auto it = module_request_map.find(module_cache_key); if (it == module_request_map.end()) { // This is the first request with this identity, record it - any mismatch @@ -1055,12 +1054,11 @@ MaybeLocal ModuleWrap::ResolveSourceCallback( return module_source_object.As(); } -static std::string GetSpecifierFromModuleRequest(Local context, - Local referrer, +static std::string GetSpecifierFromModuleRequest(Local referrer, size_t module_request_index) { Local raw_request = referrer->GetModuleRequests() - ->Get(context, static_cast(module_request_index)) + ->Get(static_cast(module_request_index)) .As(); Local specifier = raw_request->GetSpecifier(); Utf8Value specifier_utf8(Isolate::GetCurrent(), specifier); @@ -1083,14 +1081,14 @@ Maybe ModuleWrap::ResolveModule(Local context, ModuleWrap* dependent = ModuleWrap::GetFromModule(env, referrer); if (dependent == nullptr) { std::string specifier = - GetSpecifierFromModuleRequest(context, referrer, module_request_index); + GetSpecifierFromModuleRequest(referrer, module_request_index); THROW_ERR_VM_MODULE_LINK_FAILURE( env, "request for '%s' is from invalid module", specifier); return Nothing(); } if (!dependent->IsLinked()) { std::string specifier = - GetSpecifierFromModuleRequest(context, referrer, module_request_index); + GetSpecifierFromModuleRequest(referrer, module_request_index); THROW_ERR_VM_MODULE_LINK_FAILURE(env, "request for '%s' can not be resolved on " "module '%s' that is not linked", @@ -1140,7 +1138,7 @@ static MaybeLocal ImportModuleDynamicallyWithPhase( // If the host-defined options are empty, get the referrer id symbol // from the realm global object. if (options->Length() == HostDefinedOptions::kLength) { - id = options->Get(context, HostDefinedOptions::kID).As(); + id = options->Get(HostDefinedOptions::kID).As(); } else if (!context->Global() ->GetPrivate(context, env->host_defined_option_symbol()) .ToLocal(&id)) { diff --git a/src/node_builtins.cc b/src/node_builtins.cc index 2a77bf6d7a4715..644d293df45b20 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -755,7 +755,7 @@ MaybeLocal BuiltinLoader::LoadBuiltinSourceTextModule(Realm* realm, // Pre-fetch all dependencies. if (requests->Length() > 0) { for (int i = 0; i < requests->Length(); i++) { - Local req = requests->Get(context, i).As(); + Local req = requests->Get(i).As(); std::string specifier = Utf8Value(isolate, req->GetSpecifier()).ToString(); std::string resolved_id = ResolveRequestForBuiltin(specifier);