mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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 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>
This commit is contained in:
1 parent
4d5981be96
commit
710c9051e3
14 files changed
+22
-38
No files matched your search
+12
-20
@@ -374,6 +374,7 @@ tied to the life cycle of the Agent.
|
||||
### napi_set_instance_data
|
||||
<!-- YAML
|
||||
added: v12.8.0
|
||||
napiVersion: 6
|
||||
-->
|
||||
|
||||
```C
|
||||
@@ -401,6 +402,7 @@ by the previous call, it will not be called.
|
||||
### napi_get_instance_data
|
||||
<!-- YAML
|
||||
added: v12.8.0
|
||||
napiVersion: 6
|
||||
-->
|
||||
|
||||
```C
|
||||
@@ -1663,10 +1665,9 @@ the `napi_value` in question is of the JavaScript type expected by the API.
|
||||
#### napi_key_collection_mode
|
||||
<!-- YAML
|
||||
added: v13.7.0
|
||||
napiVersion: 6
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
```C
|
||||
typedef enum {
|
||||
napi_key_include_prototypes,
|
||||
@@ -1685,10 +1686,9 @@ of the objects's prototype chain as well.
|
||||
#### napi_key_filter
|
||||
<!-- YAML
|
||||
added: v13.7.0
|
||||
napiVersion: 6
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
```C
|
||||
typedef enum {
|
||||
napi_key_all_properties = 0,
|
||||
@@ -1705,10 +1705,9 @@ Property filter bits. They can be or'ed to build a composite filter.
|
||||
#### napi_key_conversion
|
||||
<!-- YAML
|
||||
added: v13.7.0
|
||||
napiVersion: 6
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
```C
|
||||
typedef enum {
|
||||
napi_key_keep_numbers,
|
||||
@@ -2262,10 +2261,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,
|
||||
@@ -2283,10 +2281,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,
|
||||
@@ -2304,10 +2301,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,
|
||||
@@ -2653,10 +2649,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,
|
||||
@@ -2680,10 +2675,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,
|
||||
@@ -2707,10 +2701,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,
|
||||
@@ -3595,10 +3588,9 @@ included.
|
||||
#### napi_get_all_property_names
|
||||
<!-- YAML
|
||||
added: v13.7.0
|
||||
napiVersion: 6
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
```C
|
||||
napi_get_all_property_names(napi_env env,
|
||||
napi_value object,
|
||||
|
||||
+6
-3
@@ -4,7 +4,6 @@
|
||||
// This file needs to be compatible with C compilers.
|
||||
#include <stddef.h> // NOLINT(modernize-deprecated-headers)
|
||||
#include <stdbool.h> // NOLINT(modernize-deprecated-headers)
|
||||
#include "js_native_api_types.h"
|
||||
|
||||
// Use INT_MAX, this should only be consumed by the pre-processor anyway.
|
||||
#define NAPI_VERSION_EXPERIMENTAL 2147483647
|
||||
@@ -18,10 +17,12 @@
|
||||
// functions available in a new version of N-API that is not yet ported in all
|
||||
// LTS versions, they can set NAPI_VERSION knowing that they have specifically
|
||||
// depended on that version.
|
||||
#define NAPI_VERSION 5
|
||||
#define NAPI_VERSION 6
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "js_native_api_types.h"
|
||||
|
||||
// If you need __declspec(dllimport), either include <node_api.h> instead, or
|
||||
// define NAPI_EXTERN as __declspec(dllimport) on the compiler's command line.
|
||||
#ifndef NAPI_EXTERN
|
||||
@@ -478,7 +479,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,
|
||||
@@ -523,7 +524,9 @@ NAPI_EXTERN napi_status napi_set_instance_data(napi_env env,
|
||||
|
||||
NAPI_EXTERN napi_status napi_get_instance_data(napi_env env,
|
||||
void** data);
|
||||
#endif // NAPI_VERSION >= 6
|
||||
|
||||
#ifdef NAPI_EXPERIMENTAL
|
||||
// ArrayBuffer detaching
|
||||
NAPI_EXTERN napi_status napi_detach_arraybuffer(napi_env env,
|
||||
napi_value arraybuffer);
|
||||
|
||||
@@ -115,7 +115,7 @@ typedef struct {
|
||||
napi_status error_code;
|
||||
} napi_extended_error_info;
|
||||
|
||||
#ifdef NAPI_EXPERIMENTAL
|
||||
#if NAPI_VERSION >= 6
|
||||
typedef enum {
|
||||
napi_key_include_prototypes,
|
||||
napi_key_own_only
|
||||
@@ -134,6 +134,6 @@ typedef enum {
|
||||
napi_key_keep_numbers,
|
||||
napi_key_numbers_to_strings
|
||||
} napi_key_conversion;
|
||||
#endif
|
||||
#endif // NAPI_VERSION >= 6
|
||||
|
||||
#endif // SRC_JS_NATIVE_API_TYPES_H_
|
||||
+1
-1
@@ -93,6 +93,6 @@
|
||||
|
||||
// The NAPI_VERSION provided by this version of the runtime. This is the version
|
||||
// which the Node binary being built supports.
|
||||
#define NAPI_VERSION 5
|
||||
#define NAPI_VERSION 6
|
||||
|
||||
#endif // SRC_NODE_VERSION_H_
|
||||
@@ -1,5 +1,3 @@
|
||||
#define NAPI_EXPERIMENTAL
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <js_native_api.h>
|
||||
|
||||
@@ -33,7 +33,7 @@ assert.notStrictEqual(test_general.testGetPrototype(baseObject),
|
||||
test_general.testGetPrototype(extendedObject));
|
||||
|
||||
// Test version management functions. The expected version is currently 4.
|
||||
assert.strictEqual(test_general.testGetVersion(), 5);
|
||||
assert.strictEqual(test_general.testGetVersion(), 6);
|
||||
|
||||
[
|
||||
123,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define NAPI_EXPERIMENTAL
|
||||
#include <js_native_api.h>
|
||||
#include "../common.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#define NAPI_EXPERIMENTAL
|
||||
#include <js_native_api.h>
|
||||
|
||||
#include "../common.h"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define NAPI_EXPERIMENTAL
|
||||
|
||||
#include <js_native_api.h>
|
||||
#include "../common.h"
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#define NAPI_EXPERIMENTAL
|
||||
#include <node_api.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../js-native-api/common.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define NAPI_EXPERIMENTAL
|
||||
#include <node_api.h>
|
||||
|
||||
static void addon_free(napi_env env, void* data, void* hint) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <uv.h>
|
||||
#define NAPI_EXPERIMENTAL
|
||||
#include <node_api.h>
|
||||
#include "../../js-native-api/common.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define NAPI_EXPERIMENTAL
|
||||
#include <node_api.h>
|
||||
|
||||
napi_value addon_new(napi_env env, napi_value exports, bool ref_first);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define NAPI_EXPERIMENTAL
|
||||
#include <node_api.h>
|
||||
|
||||
napi_value addon_new(napi_env env, napi_value exports, bool ref_first);
|
||||
|
||||
Reference in new issue
Block a user