Description
Filing so I remember to fix this
This currently impacts @resvg/resvg-js
module.exports.Resvg = class Resvg extends _Resvg {
constructor(svg, options) {
super(svg, JSON.stringify(options))
The problem in Bun is this code:
NapiClass* napi = jsDynamicCast<NapiClass*>(newTarget);
if (UNLIKELY(!napi)) {
JSC::throwVMError(globalObject, scope, JSC::createTypeError(globalObject, "NapiClass constructor called on an object that is not a NapiClass"_s));
return JSC::JSValue::encode(JSC::jsUndefined());
}
That !napi
is being returned because newTarget
is a subclass of NapiClass.
Maybe the prototype needs to be checked instead? I'm not sure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment