Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions test-app/runtime/src/main/cpp/MetadataNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,11 +859,15 @@ void MetadataNode::SetInnerTypes(v8::Isolate* isolate, Local<Function>& ctorFunc
auto context = isolate->GetCurrentContext();
const auto &children = *treeNode->children;
for (auto curChild: children) {
ctorFunction->SetAccessor(
context,
v8::String::NewFromUtf8(isolate, curChild->name.c_str()).ToLocalChecked(),
InnerTypeAccessorGetterCallback, nullptr, v8::External::New(isolate, curChild)
);
bool hasOwnProperty = ctorFunction->HasOwnProperty(context, ArgConverter::ConvertToV8String(isolate, curChild->name)).ToChecked();
// Child is defined as a function already when the inner type is a companion object
if (!hasOwnProperty) {
ctorFunction->SetAccessor(
context,
v8::String::NewFromUtf8(isolate, curChild->name.c_str()).ToLocalChecked(),
InnerTypeAccessorGetterCallback, nullptr, v8::External::New(isolate, curChild)
);
}
}
}
}
Expand Down
Loading