@@ -113,9 +113,8 @@ ModuleCacheKey ModuleCacheKey::From(Local<Context> context,
113113 DCHECK (DataIsString (import_attributes->Get (context, i)));
114114 DCHECK (DataIsString (import_attributes->Get (context, i + 1 )));
115115
116- Local<String> v8_key = import_attributes->Get (context, i).As <String>();
117- Local<String> v8_value =
118- import_attributes->Get (context, i + 1 ).As <String>();
116+ Local<String> v8_key = import_attributes->Get (i).As <String>();
117+ Local<String> v8_value = import_attributes->Get (i + 1 ).As <String>();
119118 Utf8Value key_utf8 (isolate, v8_key);
120119 Utf8Value value_utf8 (isolate, v8_value);
121120
@@ -547,8 +546,8 @@ static Local<Object> createImportAttributesContainer(
547546 LocalVector<Value> values (isolate, num_attributes);
548547
549548 for (int i = 0 ; i < raw_attributes->Length (); i += elements_per_attribute) {
550- Local<Data> key = raw_attributes->Get (realm-> context (), i);
551- Local<Data> value = raw_attributes->Get (realm-> context (), i + 1 );
549+ Local<Data> key = raw_attributes->Get (i);
550+ Local<Data> value = raw_attributes->Get (i + 1 );
552551 DCHECK (DataIsString (key));
553552 DCHECK (DataIsString (value));
554553
@@ -573,7 +572,7 @@ static Local<Array> createModuleRequestsContainer(
573572 for (int i = 0 ; i < raw_requests->Length (); i++) {
574573 DCHECK (raw_requests->Get (context, i)->IsModuleRequest ());
575574 Local<ModuleRequest> module_request =
576- raw_requests->Get (realm-> context (), i).As <ModuleRequest>();
575+ raw_requests->Get (i).As <ModuleRequest>();
577576
578577 Local<String> specifier = module_request->GetSpecifier ();
579578
@@ -661,8 +660,8 @@ void ModuleWrap::Link(const FunctionCallbackInfo<Value>& args) {
661660 // TODO(joyeecheung): merge this with the serializeKey() in module_map.js.
662661 // This currently doesn't sort the import attributes.
663662 Local<Value> module_value = modules_vector[i].Get (isolate);
664- ModuleCacheKey module_cache_key = ModuleCacheKey::From (
665- context, requests->Get (context, i).As <ModuleRequest>());
663+ ModuleCacheKey module_cache_key =
664+ ModuleCacheKey::From ( context, requests->Get (i).As <ModuleRequest>());
666665 auto it = module_request_map.find (module_cache_key);
667666 if (it == module_request_map.end ()) {
668667 // This is the first request with this identity, record it - any mismatch
@@ -1055,12 +1054,11 @@ MaybeLocal<Object> ModuleWrap::ResolveSourceCallback(
10551054 return module_source_object.As <Object>();
10561055}
10571056
1058- static std::string GetSpecifierFromModuleRequest (Local<Context> context,
1059- Local<Module> referrer,
1057+ static std::string GetSpecifierFromModuleRequest (Local<Module> referrer,
10601058 size_t module_request_index) {
10611059 Local<ModuleRequest> raw_request =
10621060 referrer->GetModuleRequests ()
1063- ->Get (context, static_cast <int >(module_request_index))
1061+ ->Get (static_cast <int >(module_request_index))
10641062 .As <ModuleRequest>();
10651063 Local<String> specifier = raw_request->GetSpecifier ();
10661064 Utf8Value specifier_utf8 (Isolate::GetCurrent (), specifier);
@@ -1083,14 +1081,14 @@ Maybe<ModuleWrap*> ModuleWrap::ResolveModule(Local<Context> context,
10831081 ModuleWrap* dependent = ModuleWrap::GetFromModule (env, referrer);
10841082 if (dependent == nullptr ) {
10851083 std::string specifier =
1086- GetSpecifierFromModuleRequest (context, referrer, module_request_index);
1084+ GetSpecifierFromModuleRequest (referrer, module_request_index);
10871085 THROW_ERR_VM_MODULE_LINK_FAILURE (
10881086 env, " request for '%s' is from invalid module" , specifier);
10891087 return Nothing<ModuleWrap*>();
10901088 }
10911089 if (!dependent->IsLinked ()) {
10921090 std::string specifier =
1093- GetSpecifierFromModuleRequest (context, referrer, module_request_index);
1091+ GetSpecifierFromModuleRequest (referrer, module_request_index);
10941092 THROW_ERR_VM_MODULE_LINK_FAILURE (env,
10951093 " request for '%s' can not be resolved on "
10961094 " module '%s' that is not linked" ,
@@ -1140,7 +1138,7 @@ static MaybeLocal<Promise> ImportModuleDynamicallyWithPhase(
11401138 // If the host-defined options are empty, get the referrer id symbol
11411139 // from the realm global object.
11421140 if (options->Length () == HostDefinedOptions::kLength ) {
1143- id = options->Get (context, HostDefinedOptions::kID ).As <Symbol>();
1141+ id = options->Get (HostDefinedOptions::kID ).As <Symbol>();
11441142 } else if (!context->Global ()
11451143 ->GetPrivate (context, env->host_defined_option_symbol ())
11461144 .ToLocal (&id)) {
0 commit comments