@@ -115,9 +115,8 @@ ModuleCacheKey ModuleCacheKey::From(Local<Context> context,
115115 DCHECK (DataIsString (import_attributes->Get (context, i)));
116116 DCHECK (DataIsString (import_attributes->Get (context, i + 1 )));
117117
118- Local<String> v8_key = import_attributes->Get (context, i).As <String>();
119- Local<String> v8_value =
120- import_attributes->Get (context, i + 1 ).As <String>();
118+ Local<String> v8_key = import_attributes->Get (i).As <String>();
119+ Local<String> v8_value = import_attributes->Get (i + 1 ).As <String>();
121120 Utf8Value key_utf8 (isolate, v8_key);
122121 Utf8Value value_utf8 (isolate, v8_value);
123122
@@ -577,8 +576,8 @@ static Local<Object> createImportAttributesContainer(
577576 LocalVector<Value> values (isolate, num_attributes);
578577
579578 for (int i = 0 ; i < raw_attributes->Length (); i += elements_per_attribute) {
580- Local<Data> key = raw_attributes->Get (realm-> context (), i);
581- Local<Data> value = raw_attributes->Get (realm-> context (), i + 1 );
579+ Local<Data> key = raw_attributes->Get (i);
580+ Local<Data> value = raw_attributes->Get (i + 1 );
582581 DCHECK (DataIsString (key));
583582 DCHECK (DataIsString (value));
584583
@@ -603,7 +602,7 @@ static Local<Array> createModuleRequestsContainer(
603602 for (int i = 0 ; i < raw_requests->Length (); i++) {
604603 DCHECK (raw_requests->Get (context, i)->IsModuleRequest ());
605604 Local<ModuleRequest> module_request =
606- raw_requests->Get (realm-> context (), i).As <ModuleRequest>();
605+ raw_requests->Get (i).As <ModuleRequest>();
607606
608607 Local<String> specifier = module_request->GetSpecifier ();
609608
@@ -691,8 +690,8 @@ void ModuleWrap::Link(const FunctionCallbackInfo<Value>& args) {
691690 // TODO(joyeecheung): merge this with the serializeKey() in module_map.js.
692691 // This currently doesn't sort the import attributes.
693692 Local<Value> module_value = modules_vector[i].Get (isolate);
694- ModuleCacheKey module_cache_key = ModuleCacheKey::From (
695- context, requests->Get (context, i).As <ModuleRequest>());
693+ ModuleCacheKey module_cache_key =
694+ ModuleCacheKey::From ( context, requests->Get (i).As <ModuleRequest>());
696695 auto it = module_request_map.find (module_cache_key);
697696 if (it == module_request_map.end ()) {
698697 // This is the first request with this identity, record it - any mismatch
@@ -1085,12 +1084,11 @@ MaybeLocal<Object> ModuleWrap::ResolveSourceCallback(
10851084 return module_source_object.As <Object>();
10861085}
10871086
1088- static std::string GetSpecifierFromModuleRequest (Local<Context> context,
1089- Local<Module> referrer,
1087+ static std::string GetSpecifierFromModuleRequest (Local<Module> referrer,
10901088 size_t module_request_index) {
10911089 Local<ModuleRequest> raw_request =
10921090 referrer->GetModuleRequests ()
1093- ->Get (context, static_cast <int >(module_request_index))
1091+ ->Get (static_cast <int >(module_request_index))
10941092 .As <ModuleRequest>();
10951093 Local<String> specifier = raw_request->GetSpecifier ();
10961094 Utf8Value specifier_utf8 (Isolate::GetCurrent (), specifier);
@@ -1113,14 +1111,14 @@ Maybe<ModuleWrap*> ModuleWrap::ResolveModule(Local<Context> context,
11131111 ModuleWrap* dependent = ModuleWrap::GetFromModule (env, referrer);
11141112 if (dependent == nullptr ) {
11151113 std::string specifier =
1116- GetSpecifierFromModuleRequest (context, referrer, module_request_index);
1114+ GetSpecifierFromModuleRequest (referrer, module_request_index);
11171115 THROW_ERR_VM_MODULE_LINK_FAILURE (
11181116 env, " request for '%s' is from invalid module" , specifier);
11191117 return Nothing<ModuleWrap*>();
11201118 }
11211119 if (!dependent->IsLinked ()) {
11221120 std::string specifier =
1123- GetSpecifierFromModuleRequest (context, referrer, module_request_index);
1121+ GetSpecifierFromModuleRequest (referrer, module_request_index);
11241122 THROW_ERR_VM_MODULE_LINK_FAILURE (env,
11251123 " request for '%s' can not be resolved on "
11261124 " module '%s' that is not linked" ,
@@ -1170,7 +1168,7 @@ static MaybeLocal<Promise> ImportModuleDynamicallyWithPhase(
11701168 // If the host-defined options are empty, get the referrer id symbol
11711169 // from the realm global object.
11721170 if (options->Length () == HostDefinedOptions::kLength ) {
1173- id = options->Get (context, HostDefinedOptions::kID ).As <Symbol>();
1171+ id = options->Get (HostDefinedOptions::kID ).As <Symbol>();
11741172 } else if (!context->Global ()
11751173 ->GetPrivate (context, env->host_defined_option_symbol ())
11761174 .ToLocal (&id)) {
0 commit comments