Add another super signature

This commit is contained in:
Luis Blanco 2019-09-06 15:37:19 +03:00
parent 1e1edf7611
commit 811bcea608
1 changed files with 11 additions and 0 deletions

View File

@ -529,6 +529,17 @@ typedef void (*Es5SetterCallback)(const Napi::CallbackInfo& info);
_super.Call(info.This(), args); \ _super.Call(info.This(), args); \
} \ } \
}; \ }; \
inline void super( \
const Napi::CallbackInfo& info, \
int argc = 0, \
const napi_value *argv = nullptr \
) { \
Napi::Function ctor = _ctorEs5.Value(); \
if (ctor.Has("super_")) { \
Napi::Function _super = ctor.Get("super_").As<Napi::Function>(); \
_super.Call(info.This(), argc, argv); \
} \
}; \
inline static Napi::Function wrap(Napi::Env env) { \ inline static Napi::Function wrap(Napi::Env env) { \
napi_value __initResult; \ napi_value __initResult; \
napi_create_function(env, #NAME, 0, CLASS::_createEs5, nullptr, &__initResult); \ napi_create_function(env, #NAME, 0, CLASS::_createEs5, nullptr, &__initResult); \