Compare commits

...

2 Commits

Author SHA1 Message Date
d38b600366 fix: some more wrapper issues 2024-03-28 14:52:49 +02:00
0ac7af2ea3 fix: take into account empty classes 2024-03-28 14:21:23 +02:00
2 changed files with 8 additions and 3 deletions

View File

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

View File

@@ -289,7 +289,7 @@ public class NativeWrapperProvider implements WrapperProvider {
}
private void initType(Class<?> clazz, FunctionValue constr, ObjectValue proto) {
if (constr != null && proto != null) return;
if (constr != null && proto != null || ignore.contains(clazz)) return;
// i vomit
if (
clazz == Object.class ||