Skip to content

Commit d8b8bc0

Browse files
ptomatoedusperoni
authored andcommitted
fix: Don't access super property on implementation object
Accessing `super` here in CallbackHandlers::GetMethodOverrides() would cause a new empty super object to be created, and try to copy the implementation object's metadata node over to it. This would fail a DCHECK because the metadata node is null. Instead, since we are checking in the next line if the property value is a function, and we know that the value of `super` isn't a function, we can instead just skip `super`.
1 parent afe026a commit d8b8bc0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test-app/runtime/src/main/cpp/CallbackHandlers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,10 @@ CallbackHandlers::GetMethodOverrides(JEnv &env, const Local<Object> &implementat
634634
auto propNames = implementationObject->GetOwnPropertyNames(context).ToLocalChecked();
635635
for (int i = 0; i < propNames->Length(); i++) {
636636
auto name = propNames->Get(context, i).ToLocalChecked().As<String>();
637+
if (name->StringEquals(V8StringConstants::GetSuper(isolate))) {
638+
continue;
639+
}
640+
637641
auto method = implementationObject->Get(context, name).ToLocalChecked();
638642

639643
bool methodFound = !method.IsEmpty() && method->IsFunction();

0 commit comments

Comments
 (0)