summaryrefslogtreecommitdiff
path: root/src/env-inl.h
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2021-01-28 23:22:18 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2021-02-08 14:00:31 +0800
commit1b7531cdeb46db2c315015f9138d95585b1064a9 (patch)
treeda791b3e3cc0e514f9c84c06904031e231ec75a2 /src/env-inl.h
parentb346cd1760dfad560d89cb797be2cf6f9f77bb77 (diff)
downloadnode-new-1b7531cdeb46db2c315015f9138d95585b1064a9.tar.gz
src: rename binding_data_name to type_name in BindingData
Previously, this was a per-class string constant for BindingData which is used as keys for identifying these objects in the binding data map. These are just type names of the BindingData. This patch renames the variable to type_name so that we can generalize this constant for other BaseObjects and use it for debugging and logging the types of other BaseObjects. PR-URL: https://github.com/nodejs/node/pull/37112 Refs: https://github.com/nodejs/node/pull/36943 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r--src/env-inl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/env-inl.h b/src/env-inl.h
index eeb74e17e2..850363af5a 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -358,7 +358,7 @@ inline T* Environment::GetBindingData(v8::Local<v8::Context> context) {
context->GetAlignedPointerFromEmbedderData(
ContextEmbedderIndex::kBindingListIndex));
DCHECK_NOT_NULL(map);
- auto it = map->find(T::binding_data_name);
+ auto it = map->find(T::type_name);
if (UNLIKELY(it == map->end())) return nullptr;
T* result = static_cast<T*>(it->second.get());
DCHECK_NOT_NULL(result);
@@ -377,7 +377,7 @@ inline T* Environment::AddBindingData(
context->GetAlignedPointerFromEmbedderData(
ContextEmbedderIndex::kBindingListIndex));
DCHECK_NOT_NULL(map);
- auto result = map->emplace(T::binding_data_name, item);
+ auto result = map->emplace(T::type_name, item);
CHECK(result.second);
DCHECK_EQ(GetBindingData<T>(context), item.get());
return item.get();