Skip to content

Commit

Permalink
Added invokeDefault for default methods
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Oct 19, 2023
1 parent 0fb85ac commit e42e32d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/src/main/java/dev/latvian/mods/rhino/VMBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ public static Object newInterfaceProxy(Object proxyHelper, final InterfaceAdapte
return "Proxy[" + target.toString() + "]";
}
}
return adapter.invoke(cx, target, topScope, proxy, method, args);

if (method.isDefault()) {
return InvocationHandler.invokeDefault(proxy, method, args);
} else {
return adapter.invoke(cx, target, topScope, proxy, method, args);
}
};
Object proxy;
try {
Expand Down

0 comments on commit e42e32d

Please sign in to comment.