fix: error now is not null-prototyped

This commit is contained in:
TopchetoEU 2023-12-24 14:30:48 +02:00
parent 3d275c52c0
commit 90da2db1fb
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -267,14 +267,12 @@ public class NativeWrapperProvider implements WrappersProvider {
else return null; else return null;
})); }));
proto.defineProperty(null, "name", new NativeFunction("name", (ctx, thisArg, args) -> getName(thisArg.getClass()))); proto.defineProperty(null, "name", new NativeFunction("name", (ctx, thisArg, args) -> getName(thisArg.getClass())));
proto.defineProperty(null, "toString", new NativeFunction("toString", (ctx, thisArg, args) -> thisArg.toString()));
var constr = makeConstructor(null, Throwable.class); var constr = makeConstructor(null, Throwable.class);
proto.defineProperty(null, "constructor", constr, true, false, false); proto.defineProperty(null, "constructor", constr, true, false, false);
constr.defineProperty(null, "prototype", proto, true, false, false); constr.defineProperty(null, "prototype", proto, true, false, false);
proto.setPrototype(null, getProto(Object.class));
constr.setPrototype(null, getConstr(Object.class));
setProto(Throwable.class, proto); setProto(Throwable.class, proto);
setConstr(Throwable.class, constr); setConstr(Throwable.class, constr);
} }