diff --git a/nan.h b/nan.h index 78e266d5..13939a3b 100644 --- a/nan.h +++ b/nan.h @@ -2615,7 +2615,11 @@ NAN_DEPRECATED inline void SetAccessor( obj->SetInternalField(imp::kDataIndex, data); } +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 12 || (V8_MAJOR_VERSION == 12 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 5)) + tpl->SetNativeDataProperty( +#else tpl->SetAccessor( +#endif name , getter_ , setter_ @@ -2663,7 +2667,11 @@ inline void SetAccessor( obj->SetInternalField(imp::kDataIndex, data); } +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 12 || (V8_MAJOR_VERSION == 12 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 5)) + tpl->SetNativeDataProperty( +#else tpl->SetAccessor( +#endif name , getter_ , setter_ @@ -2709,6 +2717,18 @@ inline bool SetAccessor( } #if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) +#if defined(V8_MAJOR_VERSION) && \ + (V8_MAJOR_VERSION > 12 || \ + (V8_MAJOR_VERSION == 12 && defined(V8_MINOR_VERSION) && \ + V8_MINOR_VERSION >= 5)) + return obj->SetNativeDataProperty( + GetCurrentContext() + , name + , getter_ + , setter_ + , dataobj + , attribute).FromMaybe(false); +#else return obj->SetAccessor( GetCurrentContext() , name @@ -2717,6 +2737,7 @@ inline bool SetAccessor( , dataobj , settings , attribute).FromMaybe(false); +#endif #else return obj->SetAccessor( name