Skip to content

Commit cd7d7b1

Browse files
committed
n-api: take n-api out of experimental
Take n-api out of experimental as per: nodejs/TSC#501 PR-URL: #19262 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
1 parent 040dd24 commit cd7d7b1

File tree

10 files changed

+3
-88
lines changed

10 files changed

+3
-88
lines changed

doc/api/n-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!--introduced_in=v7.10.0-->
44

5-
> Stability: 1 - Experimental
5+
> Stability: 2 - Stable
66

77
N-API (pronounced N as in the letter, followed by API)
88
is an API for building native Addons. It is independent from

src/env.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ Environment::Environment(IsolateData* isolate_data,
9595
printed_error_(false),
9696
trace_sync_io_(false),
9797
abort_on_uncaught_exception_(false),
98-
emit_napi_warning_(true),
9998
emit_env_nonstring_warning_(true),
10099
makecallback_cntr_(0),
101100
should_abort_on_uncaught_toggle_(isolate_, 1),
@@ -350,12 +349,6 @@ bool Environment::RemovePromiseHook(promise_hook_func fn, void* arg) {
350349
return true;
351350
}
352351

353-
bool Environment::EmitNapiWarning() {
354-
bool current_value = emit_napi_warning_;
355-
emit_napi_warning_ = false;
356-
return current_value;
357-
}
358-
359352
void Environment::EnvPromiseHook(v8::PromiseHookType type,
360353
v8::Local<v8::Promise> promise,
361354
v8::Local<v8::Value> parent) {

src/env.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ class Environment {
725725

726726
void AddPromiseHook(promise_hook_func fn, void* arg);
727727
bool RemovePromiseHook(promise_hook_func fn, void* arg);
728-
bool EmitNapiWarning();
729728
inline bool EmitProcessEnvWarning() {
730729
bool current_value = emit_env_nonstring_warning_;
731730
emit_env_nonstring_warning_ = false;
@@ -784,7 +783,6 @@ class Environment {
784783
bool printed_error_;
785784
bool trace_sync_io_;
786785
bool abort_on_uncaught_exception_;
787-
bool emit_napi_warning_;
788786
bool emit_env_nonstring_warning_;
789787
size_t makecallback_cntr_;
790788
std::vector<double> destroy_async_id_list_;

src/node.cc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,15 +2286,8 @@ static void DLOpen(const FunctionCallbackInfo<Value>& args) {
22862286
return;
22872287
}
22882288

2289-
if (mp->nm_version == -1) {
2290-
if (env->EmitNapiWarning()) {
2291-
if (ProcessEmitWarning(env, "N-API is an experimental feature and could "
2292-
"change at any time.").IsNothing()) {
2293-
dlib.Close();
2294-
return;
2295-
}
2296-
}
2297-
} else if (mp->nm_version != NODE_MODULE_VERSION) {
2289+
// -1 is used for N-API modules
2290+
if ((mp->nm_version != -1) && (mp->nm_version != NODE_MODULE_VERSION)) {
22982291
char errmsg[1024];
22992292
snprintf(errmsg,
23002293
sizeof(errmsg),

src/node_api.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
/******************************************************************************
2-
* Experimental prototype for demonstrating VM agnostic and ABI stable API
3-
* for native modules to use instead of using Nan and V8 APIs directly.
4-
*
5-
* The current status is "Experimental" and should not be used for
6-
* production applications. The API is still subject to change
7-
* and as an experimental feature is NOT subject to semver.
8-
*
9-
******************************************************************************/
10-
111
#include <node_buffer.h>
122
#include <node_object_wrap.h>
133
#include <limits.h> // INT_MAX

src/node_api.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
/******************************************************************************
2-
* Experimental prototype for demonstrating VM agnostic and ABI stable API
3-
* for native modules to use instead of using Nan and V8 APIs directly.
4-
*
5-
* The current status is "Experimental" and should not be used for
6-
* production applications. The API is still subject to change
7-
* and as an experimental feature is NOT subject to semver.
8-
*
9-
******************************************************************************/
101
#ifndef SRC_NODE_API_H_
112
#define SRC_NODE_API_H_
123

test/addons-napi/test_warning/binding.gyp

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

test/addons-napi/test_warning/test.js

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

test/addons-napi/test_warning/test_warning.c

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

test/addons-napi/test_warning/test_warning2.c

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

0 commit comments

Comments
 (0)