diff --git a/src/node_realm-inl.h b/src/node_realm-inl.h index f49690714a3ea59..e6da98671081ccd 100644 --- a/src/node_realm-inl.h +++ b/src/node_realm-inl.h @@ -86,14 +86,14 @@ inline T* Realm::AddBindingData(v8::Local context, DCHECK_EQ(GetCurrent(context), this); // This won't compile if T is not a BaseObject subclass. BaseObjectPtr item = MakeDetachedBaseObject(this, target); - BindingDataStore* map = - static_cast(context->GetAlignedPointerFromEmbedderData( - ContextEmbedderIndex::kBindingDataStoreIndex)); - DCHECK_NOT_NULL(map); + DCHECK_EQ(context->GetAlignedPointerFromEmbedderData( + ContextEmbedderIndex::kBindingDataStoreIndex), + &binding_data_store_); constexpr size_t binding_index = static_cast(T::binding_type_int); static_assert(binding_index < std::tuple_size_v); - CHECK(!(*map)[binding_index]); // Should not insert the binding twice. - (*map)[binding_index] = item; + // Should not insert the binding twice. + CHECK(!binding_data_store_[binding_index]); + binding_data_store_[binding_index] = item; DCHECK_EQ(GetBindingData(context), item.get()); return item.get(); }