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

Backport-PR-URL: #19447
PR-URL: #19262
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
  • Loading branch information
mhdawson authored and MylesBorins committed Apr 16, 2018
1 parent 3f6d80e commit 2c1190a
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 85 deletions.
1 change: 0 additions & 1 deletion src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ inline Environment::Environment(v8::Local<v8::Context> context,
using_domains_(false),
printed_error_(false),
trace_sync_io_(false),
emit_napi_warning_(true),
makecallback_cntr_(0),
async_wrap_uid_(0),
debugger_agent_(this),
Expand Down
6 changes: 0 additions & 6 deletions src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,4 @@ void Environment::PrintSyncTrace() const {
fflush(stderr);
}

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

} // namespace node
3 changes: 0 additions & 3 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,6 @@ class Environment {

static const int kContextEmbedderDataIndex = NODE_CONTEXT_EMBEDDER_DATA_INDEX;

bool EmitNapiWarning();

private:
inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
const char* errmsg);
Expand Down Expand Up @@ -570,7 +568,6 @@ class Environment {
bool using_domains_;
bool printed_error_;
bool trace_sync_io_;
bool emit_napi_warning_;
size_t makecallback_cntr_;
int64_t async_wrap_uid_;
std::vector<int64_t> destroy_ids_list_;
Expand Down
9 changes: 3 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2500,12 +2500,9 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
env->ThrowError("Module did not self-register.");
return;
}
if (mp->nm_version == -1) {
if (env->EmitNapiWarning()) {
ProcessEmitWarning(env, "N-API is an experimental feature and could "
"change at any time.");
}
} 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.

0 comments on commit 2c1190a

Please sign in to comment.