Skip to content

Commit

Permalink
fix: pass entry by reference to SymbolHasInstanceCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarahm-ed committed Oct 7, 2024
1 parent 98970ae commit 0eb9052
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test-app/runtime/src/main/cpp/MetadataNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ void MetadataNode::PackageGetterCallback(Local<Name> property, const PropertyCal
// return true;
// }
// });
RegisterSymbolHasInstanceCallback(isolate, &child, cachedItem);
RegisterSymbolHasInstanceCallback(isolate, child, cachedItem);
}

V8SetPrivateValue(isolate, thiz, strProperty, cachedItem);
Expand Down Expand Up @@ -2138,7 +2138,7 @@ void MetadataNode::SetMissingBaseMethods(
}
}

void MetadataNode::RegisterSymbolHasInstanceCallback(Isolate* isolate, MetadataEntry* entry, Local<Value> interface) {
void MetadataNode::RegisterSymbolHasInstanceCallback(Isolate* isolate, MetadataEntry& entry, Local<Value> interface) {
if (interface->IsNullOrUndefined()) {
return;
}
Expand Down Expand Up @@ -2193,9 +2193,9 @@ void MetadataNode::SymbolHasInstanceCallback(const v8::FunctionCallbackInfo<v8::
info.GetReturnValue().Set(isInstanceOf);
}

std::string MetadataNode::GetJniClassName(MetadataEntry* entry) {
std::string MetadataNode::GetJniClassName(MetadataEntry& entry) {
std::stack<string> s;
MetadataTreeNode* n = entry->treeNode;
MetadataTreeNode* n = entry.treeNode;
while (n != nullptr && n->name != "") {
s.push(n->name);
n = n->parent;
Expand Down
4 changes: 2 additions & 2 deletions test-app/runtime/src/main/cpp/MetadataNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<v8::Value> interface);
static void RegisterSymbolHasInstanceCallback(v8::Isolate* isolate, MetadataEntry& entry, v8::Local<v8::Value> interface);
static void SymbolHasInstanceCallback(const v8::FunctionCallbackInfo<v8::Value>& info);
static std::string GetJniClassName(MetadataEntry* entry);
static std::string GetJniClassName(MetadataEntry& entry);

static v8::Local<v8::Function> Wrap(v8::Isolate* isolate, const v8::Local<v8::Function>& function, const std::string& name, const std::string& origin, bool isCtorFunc);

Expand Down

0 comments on commit 0eb9052

Please sign in to comment.