File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ inline Value Env::RunScript(String script) {
322322 return Value (_env, result);
323323}
324324
325- #ifdef NAPI_EXPERIMENTAL
325+ #if NAPI_VERSION > 5
326326template <typename T, Env::Finalizer<T> fini = Env::DefaultFini<T>>
327327inline void Env::SetInstanceData (T* data) {
328328 napi_status status =
@@ -345,8 +345,7 @@ inline T* Env::GetInstanceData() {
345345template <typename T> void Env::DefaultFini (T* data) {
346346 delete data;
347347}
348-
349- #endif // NAPI_EXPERIMENTAL
348+ #endif // NAPI_VERSION > 5
350349
351350// //////////////////////////////////////////////////////////////////////////////
352351// Value class
Original file line number Diff line number Diff line change @@ -172,10 +172,10 @@ namespace Napi {
172172 // /
173173 // / In the V8 JavaScript engine, a N-API environment approximately corresponds to an Isolate.
174174 class Env {
175- #ifdef NAPI_EXPERIMENTAL
175+ #if NAPI_VERSION > 5
176176 private:
177177 template <typename T> static void DefaultFini (T* data);
178- #endif
178+ #endif // NAPI_VERSION > 5
179179 public:
180180 Env (napi_env env);
181181
@@ -192,12 +192,12 @@ namespace Napi {
192192 Value RunScript (const std::string& utf8script);
193193 Value RunScript (String script);
194194
195- #ifdef NAPI_EXPERIMENTAL
195+ #if NAPI_VERSION > 5
196196 template <typename T> using Finalizer = void (*)(T*);
197197 template <typename T, Finalizer<T> fini = Env::DefaultFini<T>>
198198 void SetInstanceData (T* data);
199199 template <typename T> T* GetInstanceData ();
200- #endif
200+ #endif // NAPI_VERSION > 5
201201
202202 private:
203203 napi_env _env;
You can’t perform that action at this time.
0 commit comments