Skip to content

Commit 73a0592

Browse files
node-api: add warning suppression for NAPI_EXPERIMENTAL
1 parent 2de000c commit 73a0592

File tree

5 files changed

+4
-35
lines changed

5 files changed

+4
-35
lines changed

β€Žsrc/js_native_api.hβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
#endif
2222
#endif
2323

24+
#if defined(NAPI_EXPERIMENTAL) && !defined(NODE_API_EXPERIMENTAL_NO_WARNING)
25+
#warning "NAPI_EXPERIMENTAL is enabled. Experimental features may be unstable."
26+
#endif
27+
2428
#include "js_native_api_types.h"
2529

2630
// If you need __declspec(dllimport), either include <node_api.h> instead, or
@@ -536,8 +540,6 @@ node_api_post_finalizer(node_api_basic_env env,
536540
void* finalize_data,
537541
void* finalize_hint);
538542

539-
#warning "NAPI_EXPERIMENTAL is enabled. Experimental features may be unstable."
540-
541543
#endif // NAPI_EXPERIMENTAL
542544

543545
#if NAPI_VERSION >= 6

β€Žsrc/node_api.hβ€Ž

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,4 @@ node_api_get_module_file_name(node_api_basic_env env, const char** result);
266266

267267
EXTERN_C_END
268268

269-
#ifdef NAPI_EXPERIMENTAL
270-
271-
#warning "NAPI_EXPERIMENTAL is enabled. Experimental features may be unstable."
272-
273-
#endif // NAPI_EXPERIMENTAL
274-
275269
#endif // SRC_NODE_API_H_

β€Žtest/addons/hello-world/binding.gypβ€Ž

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
'target_name': 'binding2',
1010
'sources': [ 'binding2.cc' ],
1111
'includes': ['../common.gypi'],
12-
},
13-
{
14-
'target_name': 'binding_experimental',
15-
'sources': [ 'binding_experimental.cc' ],
16-
'includes': ['../common.gypi'],
17-
'defines': [ 'NAPI_EXPERIMENTAL' ],
1812
}
1913
]
2014
}

β€Žtest/addons/hello-world/binding_experimental.ccβ€Ž

Lines changed: 0 additions & 17 deletions
This file was deleted.

β€Žtest/addons/hello-world/test.jsβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,3 @@ delete require.cache[bindingPath];
1414
const rebinding = require(bindingPath);
1515
assert.strictEqual(rebinding.hello(), 'world');
1616
assert.notStrictEqual(binding.hello, rebinding.hello);
17-
18-
const binding_experimental = require(require.resolve(`./build/${common.buildType}/binding_experimental`));
19-
assert.strictEqual(binding_experimental.hello(), 'world');
20-
console.log('binding_experimental.hello() =', binding_experimental.hello());

0 commit comments

Comments
Β (0)