Skip to content

Commit

Permalink
n-api: take n-api out of experimental
Browse files Browse the repository at this point in the history
Take n-api out of experimental as per:
nodejs/TSC#501
  • Loading branch information
mhdawson committed Mar 14, 2018
1 parent 861285a commit f28dfe5
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 86 deletions.
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

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
8 changes: 1 addition & 7 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2287,13 +2287,7 @@ static void DLOpen(const FunctionCallbackInfo<Value>& args) {
}

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;
}
}
// N-API module this is ok
} else if (mp->nm_version != NODE_MODULE_VERSION) {
char errmsg[1024];
snprintf(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.

0 comments on commit f28dfe5

Please sign in to comment.