Skip to content

Commit e0d376c

Browse files
author
Gabriel Schulhof
committed
update guard
1 parent 867a3bf commit e0d376c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

napi-inl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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
326326
template <typename T, Env::Finalizer<T> fini = Env::DefaultFini<T>>
327327
inline void Env::SetInstanceData(T* data) {
328328
napi_status status =
@@ -345,8 +345,7 @@ inline T* Env::GetInstanceData() {
345345
template <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

napi.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)