From 0eb90522c6c1e021fd47eb7947d8dd9d007058ed Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Tue, 8 Oct 2024 02:02:08 +0500 Subject: [PATCH] fix: pass entry by reference to SymbolHasInstanceCallback --- test-app/runtime/src/main/cpp/MetadataNode.cpp | 8 ++++---- test-app/runtime/src/main/cpp/MetadataNode.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test-app/runtime/src/main/cpp/MetadataNode.cpp b/test-app/runtime/src/main/cpp/MetadataNode.cpp index e224f6601..5096abffd 100644 --- a/test-app/runtime/src/main/cpp/MetadataNode.cpp +++ b/test-app/runtime/src/main/cpp/MetadataNode.cpp @@ -1453,7 +1453,7 @@ void MetadataNode::PackageGetterCallback(Local property, const PropertyCal // return true; // } // }); - RegisterSymbolHasInstanceCallback(isolate, &child, cachedItem); + RegisterSymbolHasInstanceCallback(isolate, child, cachedItem); } V8SetPrivateValue(isolate, thiz, strProperty, cachedItem); @@ -2138,7 +2138,7 @@ void MetadataNode::SetMissingBaseMethods( } } -void MetadataNode::RegisterSymbolHasInstanceCallback(Isolate* isolate, MetadataEntry* entry, Local interface) { +void MetadataNode::RegisterSymbolHasInstanceCallback(Isolate* isolate, MetadataEntry& entry, Local interface) { if (interface->IsNullOrUndefined()) { return; } @@ -2193,9 +2193,9 @@ void MetadataNode::SymbolHasInstanceCallback(const v8::FunctionCallbackInfo s; - MetadataTreeNode* n = entry->treeNode; + MetadataTreeNode* n = entry.treeNode; while (n != nullptr && n->name != "") { s.push(n->name); n = n->parent; diff --git a/test-app/runtime/src/main/cpp/MetadataNode.h b/test-app/runtime/src/main/cpp/MetadataNode.h index dbdcd606c..a5aa9b7c1 100644 --- a/test-app/runtime/src/main/cpp/MetadataNode.h +++ b/test-app/runtime/src/main/cpp/MetadataNode.h @@ -161,9 +161,9 @@ class MetadataNode { static bool GetExtendLocation(v8::Isolate* isolate, std::string& extendLocation, bool isTypeScriptExtend); static ExtendedClassCacheData GetCachedExtendedClassData(v8::Isolate* isolate, const std::string& proxyClassName); - static void RegisterSymbolHasInstanceCallback(v8::Isolate* isolate, MetadataEntry* entry, v8::Local interface); + static void RegisterSymbolHasInstanceCallback(v8::Isolate* isolate, MetadataEntry& entry, v8::Local interface); static void SymbolHasInstanceCallback(const v8::FunctionCallbackInfo& info); - static std::string GetJniClassName(MetadataEntry* entry); + static std::string GetJniClassName(MetadataEntry& entry); static v8::Local Wrap(v8::Isolate* isolate, const v8::Local& function, const std::string& name, const std::string& origin, bool isCtorFunc);