-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Labels
bugSomething isn't workingSomething isn't workingnapiCompatibility with the native layer of Node.jsCompatibility with the native layer of Node.js
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.
yisibl
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingnapiCompatibility with the native layer of Node.jsCompatibility with the native layer of Node.js