Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schulhof <gabriel.schulhof@intel.com>2020-03-03 03:53:06 +0300
committerBeth Griggs <Bethany.Griggs@uk.ibm.com>2020-04-06 13:39:06 +0300
commite9c590ea00ca8c6b73bf48652613730cdbcbf703 (patch)
tree18d389c9cc76729d036e89c5a0eed32b82507a2a
parent239377b65460d166784dce58399c6c56680a3865 (diff)
n-api: define release 6
Mark all N-APIs that have been added since version 5 as stable. PR-URL: https://github.com/nodejs/node/pull/32058 Backport-PR-URL: https://github.com/nodejs/node/pull/32488 Fixes: https://github.com/nodejs/abi-stable-node/issues/393 Co-Authored-By: legendecas <legendecas@gmail.com> Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
-rw-r--r--doc/api/n-api.md32
-rw-r--r--src/node_api.h6
-rw-r--r--src/node_api_types.h4
-rw-r--r--src/node_version.h5
-rw-r--r--test/addons-napi/test_bigint/test_bigint.c2
-rw-r--r--test/addons-napi/test_general/test.js2
-rw-r--r--test/addons-napi/test_instance_data/test_instance_data.c1
-rw-r--r--test/addons-napi/test_object/test_object.c1
8 files changed, 21 insertions, 32 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md
index 383b70625e0..f00111faa3b 100644
--- a/doc/api/n-api.md
+++ b/doc/api/n-api.md
@@ -189,6 +189,7 @@ tied to the life cycle of the Agent.
### napi_set_instance_data
<!-- YAML
added: REPLACEME
+napiVersion: 6
-->
```C
@@ -216,6 +217,7 @@ by the previous call, it will not be called.
### napi_get_instance_data
<!-- YAML
added: REPLACEME
+napiVersion: 6
-->
```C
@@ -1375,10 +1377,9 @@ the `napi_value` in question is of the JavaScript type expected by the API.
#### napi_key_collection_mode
<!-- YAML
added: REPLACEME
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
typedef enum {
napi_key_include_prototypes,
@@ -1397,10 +1398,9 @@ of the objects's prototype chain as well.
#### napi_key_filter
<!-- YAML
added: REPLACEME
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
typedef enum {
napi_key_all_properties = 0,
@@ -1417,10 +1417,9 @@ Property filter bits. They can be or'ed to build a composite filter.
#### napi_key_conversion
<!-- YAML
added: REPLACEME
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
typedef enum {
napi_key_keep_numbers,
@@ -1940,10 +1939,9 @@ The JavaScript `Number` type is described in
#### napi_create_bigint_int64
<!-- YAML
added: v10.7.0
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
napi_status napi_create_bigint_int64(napi_env env,
int64_t value,
@@ -1961,10 +1959,9 @@ This API converts the C `int64_t` type to the JavaScript `BigInt` type.
#### napi_create_bigint_uint64
<!-- YAML
added: v10.7.0
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
napi_status napi_create_bigint_uint64(napi_env env,
uint64_t value,
@@ -1982,10 +1979,9 @@ This API converts the C `uint64_t` type to the JavaScript `BigInt` type.
#### napi_create_bigint_words
<!-- YAML
added: v10.7.0
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
napi_status napi_create_bigint_words(napi_env env,
int sign_bit,
@@ -2319,10 +2315,9 @@ This API returns the C double primitive equivalent of the given JavaScript
#### napi_get_value_bigint_int64
<!-- YAML
added: v10.7.0
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
napi_status napi_get_value_bigint_int64(napi_env env,
napi_value value,
@@ -2347,10 +2342,9 @@ This API returns the C `int64_t` primitive equivalent of the given JavaScript
#### napi_get_value_bigint_uint64
<!-- YAML
added: v10.7.0
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
napi_status napi_get_value_bigint_uint64(napi_env env,
napi_value value,
@@ -2375,10 +2369,9 @@ This API returns the C `uint64_t` primitive equivalent of the given JavaScript
#### napi_get_value_bigint_words
<!-- YAML
added: v10.7.0
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
napi_status napi_get_value_bigint_words(napi_env env,
napi_value value,
@@ -3189,10 +3182,9 @@ included.
#### napi_get_all_property_names
<!-- YAML
added: REPLACEME
+napiVersion: 6
-->
-> Stability: 1 - Experimental
-
```C
napi_get_all_property_names(napi_env env,
napi_value object,
diff --git a/src/node_api.h b/src/node_api.h
index 0bf2e2a912f..4b881027494 100644
--- a/src/node_api.h
+++ b/src/node_api.h
@@ -10,7 +10,7 @@
#define NAPI_VERSION 2147483647
#else
// The baseline version for N-API
-#define NAPI_VERSION 5
+#define NAPI_VERSION 6
#endif
#endif
@@ -699,7 +699,7 @@ NAPI_EXTERN napi_status napi_add_finalizer(napi_env env,
#endif // NAPI_VERSION >= 5
-#ifdef NAPI_EXPERIMENTAL
+#if NAPI_VERSION >= 6
// BigInt
NAPI_EXTERN napi_status napi_create_bigint_int64(napi_env env,
@@ -745,7 +745,7 @@ napi_get_all_property_names(napi_env env,
napi_key_conversion key_conversion,
napi_value* result);
-#endif // NAPI_EXPERIMENTAL
+#endif // NAPI_VERSION >= 6
EXTERN_C_END
diff --git a/src/node_api_types.h b/src/node_api_types.h
index 9f89710d929..55158fa412e 100644
--- a/src/node_api_types.h
+++ b/src/node_api_types.h
@@ -147,7 +147,7 @@ typedef struct {
const char* release;
} napi_node_version;
-#ifdef NAPI_EXPERIMENTAL
+#if NAPI_VERSION >= 6
typedef enum {
napi_key_include_prototypes,
napi_key_own_only
@@ -166,6 +166,6 @@ typedef enum {
napi_key_keep_numbers,
napi_key_numbers_to_strings
} napi_key_conversion;
-#endif
+#endif // NAPI_VERSION >= 6
#endif // SRC_NODE_API_TYPES_H_
diff --git a/src/node_version.h b/src/node_version.h
index 793d07592f7..cb310f216f9 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -113,7 +113,8 @@
*/
#define NODE_MODULE_VERSION 64
-// the NAPI_VERSION provided by this version of the runtime
-#define NAPI_VERSION 5
+// The NAPI_VERSION provided by this version of the runtime. This is the version
+// which the Node binary being built supports.
+#define NAPI_VERSION 6
#endif // SRC_NODE_VERSION_H_
diff --git a/test/addons-napi/test_bigint/test_bigint.c b/test/addons-napi/test_bigint/test_bigint.c
index b1e6c359db6..b7c887fa33e 100644
--- a/test/addons-napi/test_bigint/test_bigint.c
+++ b/test/addons-napi/test_bigint/test_bigint.c
@@ -1,5 +1,3 @@
-#define NAPI_EXPERIMENTAL
-
#include <inttypes.h>
#include <stdio.h>
#include <node_api.h>
diff --git a/test/addons-napi/test_general/test.js b/test/addons-napi/test_general/test.js
index 3ed1f5199dd..1e0a98f48d3 100644
--- a/test/addons-napi/test_general/test.js
+++ b/test/addons-napi/test_general/test.js
@@ -34,7 +34,7 @@ assert.notStrictEqual(test_general.testGetPrototype(baseObject),
// test version management functions
// expected version is currently 4
-assert.strictEqual(test_general.testGetVersion(), 5);
+assert.strictEqual(test_general.testGetVersion(), 6);
const [ major, minor, patch, release ] = test_general.testGetNodeVersion();
assert.strictEqual(process.version.split('-')[0],
diff --git a/test/addons-napi/test_instance_data/test_instance_data.c b/test/addons-napi/test_instance_data/test_instance_data.c
index edf56408061..55e0deba54b 100644
--- a/test/addons-napi/test_instance_data/test_instance_data.c
+++ b/test/addons-napi/test_instance_data/test_instance_data.c
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>
-#define NAPI_EXPERIMENTAL
#include <node_api.h>
#include "../common.h"
diff --git a/test/addons-napi/test_object/test_object.c b/test/addons-napi/test_object/test_object.c
index dbf840cb09c..90fa69dd6a1 100644
--- a/test/addons-napi/test_object/test_object.c
+++ b/test/addons-napi/test_object/test_object.c
@@ -1,4 +1,3 @@
-#define NAPI_EXPERIMENTAL
#include <node_api.h>
#include "../common.h"
#include <string.h>