Skip to content

Commit 2c1190a

Browse files
mhdawsonMylesBorins
authored andcommitted
n-api: take n-api out of experimental
Take n-api out of experimental as per: nodejs/TSC#501 Backport-PR-URL: #19447 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 3f6d80e commit 2c1190a

File tree

10 files changed

+3
-85
lines changed

10 files changed

+3
-85
lines changed

src/env-inl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ inline Environment::Environment(v8::Local<v8::Context> context,
223223
using_domains_(false),
224224
printed_error_(false),
225225
trace_sync_io_(false),
226-
emit_napi_warning_(true),
227226
makecallback_cntr_(0),
228227
async_wrap_uid_(0),
229228
debugger_agent_(this),

src/env.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,4 @@ void Environment::PrintSyncTrace() const {
6161
fflush(stderr);
6262
}
6363

64-
bool Environment::EmitNapiWarning() {
65-
bool current_value = emit_napi_warning_;
66-
emit_napi_warning_ = false;
67-
return current_value;
68-
}
69-
7064
} // namespace node

src/env.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,6 @@ class Environment {
537537

538538
static const int kContextEmbedderDataIndex = NODE_CONTEXT_EMBEDDER_DATA_INDEX;
539539

540-
bool EmitNapiWarning();
541-
542540
private:
543541
inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
544542
const char* errmsg);
@@ -570,7 +568,6 @@ class Environment {
570568
bool using_domains_;
571569
bool printed_error_;
572570
bool trace_sync_io_;
573-
bool emit_napi_warning_;
574571
size_t makecallback_cntr_;
575572
int64_t async_wrap_uid_;
576573
std::vector<int64_t> destroy_ids_list_;

src/node.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,12 +2500,9 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
25002500
env->ThrowError("Module did not self-register.");
25012501
return;
25022502
}
2503-
if (mp->nm_version == -1) {
2504-
if (env->EmitNapiWarning()) {
2505-
ProcessEmitWarning(env, "N-API is an experimental feature and could "
2506-
"change at any time.");
2507-
}
2508-
} else if (mp->nm_version != NODE_MODULE_VERSION) {
2503+
2504+
// -1 is used for N-API modules
2505+
if ((mp->nm_version != -1) && (mp->nm_version != NODE_MODULE_VERSION)) {
25092506
char errmsg[1024];
25102507
snprintf(errmsg,
25112508
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)