diff --git a/src/jsc/jsc_class.hpp b/src/jsc/jsc_class.hpp index 0a236219..31e7e28b 100644 --- a/src/jsc/jsc_class.hpp +++ b/src/jsc/jsc_class.hpp @@ -169,7 +169,7 @@ inline JSClassRef ObjectWrap::create_constructor_class() { // This must be set for `typeof constructor` to be 'function'. definition.callAsFunction = call; - if (s_class.constructor) { + if (reinterpret_cast(s_class.constructor)) { definition.callAsConstructor = construct; } if (!s_class.static_methods.empty()) { @@ -226,7 +226,7 @@ inline JSValueRef ObjectWrap::call(JSContextRef ctx, JSObjectRef func } // Classes without a constructor should still be subclassable. - if (s_class.constructor) { + if (reinterpret_cast(s_class.constructor)) { try { s_class.constructor(ctx, this_object, argc, arguments); } @@ -241,7 +241,7 @@ inline JSValueRef ObjectWrap::call(JSContextRef ctx, JSObjectRef func template inline JSObjectRef ObjectWrap::construct(JSContextRef ctx, JSObjectRef constructor, size_t argc, const JSValueRef arguments[], JSValueRef* exception) { - if (!s_class.constructor) { + if (!reinterpret_cast(s_class.constructor)) { *exception = jsc::Exception::value(ctx, s_class.name + " is not a constructor"); return nullptr; } diff --git a/src/node/node_class.hpp b/src/node/node_class.hpp index ea95cf98..4072cd3e 100644 --- a/src/node/node_class.hpp +++ b/src/node/node_class.hpp @@ -226,7 +226,7 @@ inline void ObjectWrap::construct(Nan::NAN_METHOD_ARGS_TYPE info) { if (!info.IsConstructCall()) { Nan::ThrowError("Constructor must be called with new"); } - if (s_class.constructor) { + if (reinterpret_cast(s_class.constructor)) { auto isolate = info.GetIsolate(); auto arguments = get_arguments(info); v8::Local this_object = info.This();