Skip to content

Commit e1e2c2d

Browse files
Gabriel Schulhoflegendecas
Gabriel Schulhof
andcommitted
n-api: define release 6
Mark all N-APIs that have been added since version 5 as stable. PR-URL: nodejs#32058 Fixes: nodejs/abi-stable-node#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>
1 parent 07c0385 commit e1e2c2d

File tree

8 files changed

+21
-32
lines changed

8 files changed

+21
-32
lines changed

doc/api/n-api.md

+12-20
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ tied to the life cycle of the Agent.
189189
### napi_set_instance_data
190190
<!-- YAML
191191
added: REPLACEME
192+
napiVersion: 6
192193
-->
193194

194195
```C
@@ -216,6 +217,7 @@ by the previous call, it will not be called.
216217
### napi_get_instance_data
217218
<!-- YAML
218219
added: REPLACEME
220+
napiVersion: 6
219221
-->
220222

221223
```C
@@ -1375,10 +1377,9 @@ the `napi_value` in question is of the JavaScript type expected by the API.
13751377
#### napi_key_collection_mode
13761378
<!-- YAML
13771379
added: REPLACEME
1380+
napiVersion: 6
13781381
-->
13791382

1380-
> Stability: 1 - Experimental
1381-
13821383
```C
13831384
typedef enum {
13841385
napi_key_include_prototypes,
@@ -1397,10 +1398,9 @@ of the objects's prototype chain as well.
13971398
#### napi_key_filter
13981399
<!-- YAML
13991400
added: REPLACEME
1401+
napiVersion: 6
14001402
-->
14011403

1402-
> Stability: 1 - Experimental
1403-
14041404
```C
14051405
typedef enum {
14061406
napi_key_all_properties = 0,
@@ -1417,10 +1417,9 @@ Property filter bits. They can be or'ed to build a composite filter.
14171417
#### napi_key_conversion
14181418
<!-- YAML
14191419
added: REPLACEME
1420+
napiVersion: 6
14201421
-->
14211422

1422-
> Stability: 1 - Experimental
1423-
14241423
```C
14251424
typedef enum {
14261425
napi_key_keep_numbers,
@@ -1940,10 +1939,9 @@ The JavaScript `Number` type is described in
19401939
#### napi_create_bigint_int64
19411940
<!-- YAML
19421941
added: v10.7.0
1942+
napiVersion: 6
19431943
-->
19441944

1945-
> Stability: 1 - Experimental
1946-
19471945
```C
19481946
napi_status napi_create_bigint_int64(napi_env env,
19491947
int64_t value,
@@ -1961,10 +1959,9 @@ This API converts the C `int64_t` type to the JavaScript `BigInt` type.
19611959
#### napi_create_bigint_uint64
19621960
<!-- YAML
19631961
added: v10.7.0
1962+
napiVersion: 6
19641963
-->
19651964

1966-
> Stability: 1 - Experimental
1967-
19681965
```C
19691966
napi_status napi_create_bigint_uint64(napi_env env,
19701967
uint64_t value,
@@ -1982,10 +1979,9 @@ This API converts the C `uint64_t` type to the JavaScript `BigInt` type.
19821979
#### napi_create_bigint_words
19831980
<!-- YAML
19841981
added: v10.7.0
1982+
napiVersion: 6
19851983
-->
19861984

1987-
> Stability: 1 - Experimental
1988-
19891985
```C
19901986
napi_status napi_create_bigint_words(napi_env env,
19911987
int sign_bit,
@@ -2319,10 +2315,9 @@ This API returns the C double primitive equivalent of the given JavaScript
23192315
#### napi_get_value_bigint_int64
23202316
<!-- YAML
23212317
added: v10.7.0
2318+
napiVersion: 6
23222319
-->
23232320

2324-
> Stability: 1 - Experimental
2325-
23262321
```C
23272322
napi_status napi_get_value_bigint_int64(napi_env env,
23282323
napi_value value,
@@ -2347,10 +2342,9 @@ This API returns the C `int64_t` primitive equivalent of the given JavaScript
23472342
#### napi_get_value_bigint_uint64
23482343
<!-- YAML
23492344
added: v10.7.0
2345+
napiVersion: 6
23502346
-->
23512347

2352-
> Stability: 1 - Experimental
2353-
23542348
```C
23552349
napi_status napi_get_value_bigint_uint64(napi_env env,
23562350
napi_value value,
@@ -2375,10 +2369,9 @@ This API returns the C `uint64_t` primitive equivalent of the given JavaScript
23752369
#### napi_get_value_bigint_words
23762370
<!-- YAML
23772371
added: v10.7.0
2372+
napiVersion: 6
23782373
-->
23792374

2380-
> Stability: 1 - Experimental
2381-
23822375
```C
23832376
napi_status napi_get_value_bigint_words(napi_env env,
23842377
napi_value value,
@@ -3189,10 +3182,9 @@ included.
31893182
#### napi_get_all_property_names
31903183
<!-- YAML
31913184
added: REPLACEME
3185+
napiVersion: 6
31923186
-->
31933187

3194-
> Stability: 1 - Experimental
3195-
31963188
```C
31973189
napi_get_all_property_names(napi_env env,
31983190
napi_value object,

src/node_api.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define NAPI_VERSION 2147483647
1111
#else
1212
// The baseline version for N-API
13-
#define NAPI_VERSION 5
13+
#define NAPI_VERSION 6
1414
#endif
1515
#endif
1616

@@ -699,7 +699,7 @@ NAPI_EXTERN napi_status napi_add_finalizer(napi_env env,
699699

700700
#endif // NAPI_VERSION >= 5
701701

702-
#ifdef NAPI_EXPERIMENTAL
702+
#if NAPI_VERSION >= 6
703703

704704
// BigInt
705705
NAPI_EXTERN napi_status napi_create_bigint_int64(napi_env env,
@@ -745,7 +745,7 @@ napi_get_all_property_names(napi_env env,
745745
napi_key_conversion key_conversion,
746746
napi_value* result);
747747

748-
#endif // NAPI_EXPERIMENTAL
748+
#endif // NAPI_VERSION >= 6
749749

750750
EXTERN_C_END
751751

src/node_api_types.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ typedef struct {
147147
const char* release;
148148
} napi_node_version;
149149

150-
#ifdef NAPI_EXPERIMENTAL
150+
#if NAPI_VERSION >= 6
151151
typedef enum {
152152
napi_key_include_prototypes,
153153
napi_key_own_only
@@ -166,6 +166,6 @@ typedef enum {
166166
napi_key_keep_numbers,
167167
napi_key_numbers_to_strings
168168
} napi_key_conversion;
169-
#endif
169+
#endif // NAPI_VERSION >= 6
170170

171171
#endif // SRC_NODE_API_TYPES_H_

src/node_version.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@
113113
*/
114114
#define NODE_MODULE_VERSION 64
115115

116-
// the NAPI_VERSION provided by this version of the runtime
117-
#define NAPI_VERSION 5
116+
// The NAPI_VERSION provided by this version of the runtime. This is the version
117+
// which the Node binary being built supports.
118+
#define NAPI_VERSION 6
118119

119120
#endif // SRC_NODE_VERSION_H_

test/addons-napi/test_bigint/test_bigint.c

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#define NAPI_EXPERIMENTAL
2-
31
#include <inttypes.h>
42
#include <stdio.h>
53
#include <node_api.h>

test/addons-napi/test_general/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ assert.notStrictEqual(test_general.testGetPrototype(baseObject),
3434

3535
// test version management functions
3636
// expected version is currently 4
37-
assert.strictEqual(test_general.testGetVersion(), 5);
37+
assert.strictEqual(test_general.testGetVersion(), 6);
3838

3939
const [ major, minor, patch, release ] = test_general.testGetNodeVersion();
4040
assert.strictEqual(process.version.split('-')[0],

test/addons-napi/test_instance_data/test_instance_data.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <stdio.h>
22
#include <stdlib.h>
33
#include <uv.h>
4-
#define NAPI_EXPERIMENTAL
54
#include <node_api.h>
65
#include "../common.h"
76

test/addons-napi/test_object/test_object.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define NAPI_EXPERIMENTAL
21
#include <node_api.h>
32
#include "../common.h"
43
#include <string.h>

0 commit comments

Comments
 (0)