8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d5981b commit 710c905Copy full SHA for 710c905
doc/api/n-api.md
@@ -374,6 +374,7 @@ tied to the life cycle of the Agent.
374
### napi_set_instance_data
375
<!-- YAML
376
added: v12.8.0
377
+napiVersion: 6
378
-->
379
380
```C
@@ -401,6 +402,7 @@ by the previous call, it will not be called.
401
402
### napi_get_instance_data
403
404
405
406
407
408
@@ -1663,10 +1665,9 @@ the `napi_value` in question is of the JavaScript type expected by the API.
1663
1665
#### napi_key_collection_mode
1664
1666
1667
added: v13.7.0
1668
1669
1670
-> Stability: 1 - Experimental
-
1671
1672
typedef enum {
1673
napi_key_include_prototypes,
@@ -1685,10 +1686,9 @@ of the objects's prototype chain as well.
1685
1686
#### napi_key_filter
1687
1688
1689
1690
1691
1692
1693
1694
napi_key_all_properties = 0,
@@ -1705,10 +1705,9 @@ Property filter bits. They can be or'ed to build a composite filter.
1705
#### napi_key_conversion
1706
1707
1708
1709
1710
1711
1712
1713
1714
napi_key_keep_numbers,
@@ -2262,10 +2261,9 @@ The JavaScript `Number` type is described in
2262
2261
#### napi_create_bigint_int64
2263
2264
added: v10.7.0
2265
2266
2267
2268
2269
2270
napi_status napi_create_bigint_int64(napi_env env,
2271
int64_t value,
@@ -2283,10 +2281,9 @@ This API converts the C `int64_t` type to the JavaScript `BigInt` type.
2283
2281
#### napi_create_bigint_uint64
2284
2282
2285
2286
2287
2288
2289
2290
2291
napi_status napi_create_bigint_uint64(napi_env env,
2292
uint64_t value,
@@ -2304,10 +2301,9 @@ This API converts the C `uint64_t` type to the JavaScript `BigInt` type.
2304
2301
#### napi_create_bigint_words
2305
2302
2306
2303
2307
2308
2309
2310
2311
2312
napi_status napi_create_bigint_words(napi_env env,
2313
int sign_bit,
@@ -2653,10 +2649,9 @@ This API returns the C double primitive equivalent of the given JavaScript
2653
2649
#### napi_get_value_bigint_int64
2654
2650
2655
2651
2652
2656
2657
2658
2659
2660
2661
napi_status napi_get_value_bigint_int64(napi_env env,
2662
napi_value value,
@@ -2680,10 +2675,9 @@ This API returns the C `int64_t` primitive equivalent of the given JavaScript
2680
2675
#### napi_get_value_bigint_uint64
2681
2676
2682
2677
2678
2683
2679
2684
2685
2686
2687
2688
napi_status napi_get_value_bigint_uint64(napi_env env,
2689
@@ -2707,10 +2701,9 @@ This API returns the C `uint64_t` primitive equivalent of the given JavaScript
2707
2701
#### napi_get_value_bigint_words
2708
2702
2709
2703
2704
2710
2705
2711
2706
2712
2713
2714
2715
napi_status napi_get_value_bigint_words(napi_env env,
2716
@@ -3595,10 +3588,9 @@ included.
3595
3588
#### napi_get_all_property_names
3596
3589
3597
3590
3591
3598
3592
3599
3593
3600
3601
3602
3594
3603
napi_get_all_property_names(napi_env env,
3604
napi_value object,
src/js_native_api.h
@@ -4,7 +4,6 @@
4
// This file needs to be compatible with C compilers.
5
#include <stddef.h> // NOLINT(modernize-deprecated-headers)
6
#include <stdbool.h> // NOLINT(modernize-deprecated-headers)
7
-#include "js_native_api_types.h"
8
9
// Use INT_MAX, this should only be consumed by the pre-processor anyway.
10
#define NAPI_VERSION_EXPERIMENTAL 2147483647
@@ -18,10 +17,12 @@
18
17
// functions available in a new version of N-API that is not yet ported in all
19
// LTS versions, they can set NAPI_VERSION knowing that they have specifically
20
// depended on that version.
21
-#define NAPI_VERSION 5
+#define NAPI_VERSION 6
22
#endif
23
24
+#include "js_native_api_types.h"
25
+
26
// If you need __declspec(dllimport), either include <node_api.h> instead, or
27
// define NAPI_EXTERN as __declspec(dllimport) on the compiler's command line.
28
#ifndef NAPI_EXTERN
@@ -478,7 +479,7 @@ NAPI_EXTERN napi_status napi_add_finalizer(napi_env env,
478
479
480
#endif // NAPI_VERSION >= 5
481
-#ifdef NAPI_EXPERIMENTAL
482
+#if NAPI_VERSION >= 6
483
484
// BigInt
485
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,
523
524
525
NAPI_EXTERN napi_status napi_get_instance_data(napi_env env,
526
void** data);
527
+#endif // NAPI_VERSION >= 6
528
529
+#ifdef NAPI_EXPERIMENTAL
530
// ArrayBuffer detaching
531
NAPI_EXTERN napi_status napi_detach_arraybuffer(napi_env env,
532
napi_value arraybuffer);
src/js_native_api_types.h
@@ -115,7 +115,7 @@ typedef struct {
115
napi_status error_code;
116
} napi_extended_error_info;
117
118
119
120
121
napi_key_own_only
@@ -134,6 +134,6 @@ typedef enum {
134
135
napi_key_numbers_to_strings
136
} napi_key_conversion;
137
-#endif
138
139
#endif // SRC_JS_NATIVE_API_TYPES_H_
src/node_version.h
@@ -93,6 +93,6 @@
93
94
// The NAPI_VERSION provided by this version of the runtime. This is the version
95
// which the Node binary being built supports.
96
97
98
#endif // SRC_NODE_VERSION_H_
test/js-native-api/test_bigint/test_bigint.c
@@ -1,5 +1,3 @@
1
-#define NAPI_EXPERIMENTAL
2
3
#include <inttypes.h>
#include <stdio.h>
#include <js_native_api.h>
test/js-native-api/test_general/test.js
@@ -33,7 +33,7 @@ assert.notStrictEqual(test_general.testGetPrototype(baseObject),
33
test_general.testGetPrototype(extendedObject));
34
35
// Test version management functions. The expected version is currently 4.
36
-assert.strictEqual(test_general.testGetVersion(), 5);
+assert.strictEqual(test_general.testGetVersion(), 6);
37
38
[
39
123,
test/js-native-api/test_instance_data/test_instance_data.c
@@ -1,6 +1,5 @@
#include <stdlib.h>
#include "../common.h"
test/js-native-api/test_object/test_null.c
@@ -1,4 +1,3 @@
test/js-native-api/test_object/test_object.c
#include <string.h>
test/node-api/test_general/test_general.c
#include <node_api.h>
#include "../../js-native-api/common.h"