fix: error now is not null-prototyped
This commit is contained in:
parent
3d275c52c0
commit
90da2db1fb
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user