fix: some more wrapper issues

This commit is contained in:
TopchetoEU 2024-03-28 14:52:49 +02:00
parent 0ac7af2ea3
commit d38b600366
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -9,8 +9,13 @@ public class NativeWrapper extends ObjectValue {
@Override @Override
public ObjectValue getPrototype(Context ctx) { public ObjectValue getPrototype(Context ctx) {
if (ctx.environment != null && prototype == NATIVE_PROTO) { if (ctx.environment != null && prototype == NATIVE_PROTO) {
var res = ctx.environment.wrappers.getProto(wrapped.getClass()); var clazz = wrapped.getClass();
if (res != null) return res;
while (true) {
var res = ctx.environment.wrappers.getProto(clazz);
if (res != null) return res;
clazz = clazz.getSuperclass();
}
} }
return super.getPrototype(ctx); return super.getPrototype(ctx);
} }