Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n-api: take n-api out of experimental #19262

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

> Stability: 1 - Experimental
> Stability: 2 - Stable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we track changes like this in the documentation with YAML metadata?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the existing docs, I don't think so.


N-API (pronounced N as in the letter, followed by API)
is an API for building native Addons. It is independent from
Expand Down
7 changes: 0 additions & 7 deletions src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Environment::Environment(IsolateData* isolate_data,
printed_error_(false),
trace_sync_io_(false),
abort_on_uncaught_exception_(false),
emit_napi_warning_(true),
emit_env_nonstring_warning_(true),
makecallback_cntr_(0),
should_abort_on_uncaught_toggle_(isolate_, 1),
Expand Down Expand Up @@ -350,12 +349,6 @@ bool Environment::RemovePromiseHook(promise_hook_func fn, void* arg) {
return true;
}

bool Environment::EmitNapiWarning() {
bool current_value = emit_napi_warning_;
emit_napi_warning_ = false;
return current_value;
}

void Environment::EnvPromiseHook(v8::PromiseHookType type,
v8::Local<v8::Promise> promise,
v8::Local<v8::Value> parent) {
Expand Down
2 changes: 0 additions & 2 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,6 @@ class Environment {

void AddPromiseHook(promise_hook_func fn, void* arg);
bool RemovePromiseHook(promise_hook_func fn, void* arg);
bool EmitNapiWarning();
inline bool EmitProcessEnvWarning() {
bool current_value = emit_env_nonstring_warning_;
emit_env_nonstring_warning_ = false;
Expand Down Expand Up @@ -784,7 +783,6 @@ class Environment {
bool printed_error_;
bool trace_sync_io_;
bool abort_on_uncaught_exception_;
bool emit_napi_warning_;
bool emit_env_nonstring_warning_;
size_t makecallback_cntr_;
std::vector<double> destroy_async_id_list_;
Expand Down
11 changes: 2 additions & 9 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2286,15 +2286,8 @@ static void DLOpen(const FunctionCallbackInfo<Value>& args) {
return;
}

if (mp->nm_version == -1) {
if (env->EmitNapiWarning()) {
if (ProcessEmitWarning(env, "N-API is an experimental feature and could "
"change at any time.").IsNothing()) {
dlib.Close();
return;
}
}
} else if (mp->nm_version != NODE_MODULE_VERSION) {
// -1 is used for N-API modules
if ((mp->nm_version != -1) && (mp->nm_version != NODE_MODULE_VERSION)) {
char errmsg[1024];
snprintf(errmsg,
sizeof(errmsg),
Expand Down
10 changes: 0 additions & 10 deletions src/node_api.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/******************************************************************************
* Experimental prototype for demonstrating VM agnostic and ABI stable API
* for native modules to use instead of using Nan and V8 APIs directly.
*
* The current status is "Experimental" and should not be used for
* production applications. The API is still subject to change
* and as an experimental feature is NOT subject to semver.
*
******************************************************************************/

#include <node_buffer.h>
#include <node_object_wrap.h>
#include <limits.h> // INT_MAX
Expand Down
9 changes: 0 additions & 9 deletions src/node_api.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/******************************************************************************
* Experimental prototype for demonstrating VM agnostic and ABI stable API
* for native modules to use instead of using Nan and V8 APIs directly.
*
* The current status is "Experimental" and should not be used for
* production applications. The API is still subject to change
* and as an experimental feature is NOT subject to semver.
*
******************************************************************************/
#ifndef SRC_NODE_API_H_
#define SRC_NODE_API_H_

Expand Down
12 changes: 0 additions & 12 deletions test/addons-napi/test_warning/binding.gyp

This file was deleted.

16 changes: 0 additions & 16 deletions test/addons-napi/test_warning/test.js

This file was deleted.

11 changes: 0 additions & 11 deletions test/addons-napi/test_warning/test_warning.c

This file was deleted.

11 changes: 0 additions & 11 deletions test/addons-napi/test_warning/test_warning2.c

This file was deleted.