Skip to content

Commit dd80316

Browse files
Gabriel Schulhofjoesepi
authored andcommitted
n-api: create N-API version 7
Mark `napi_detach_arraybuffer` and `napi_is_detached_arraybuffer` as stable. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: nodejs#35199 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent d7b075e commit dd80316

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

doc/api/n-api.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,10 +3558,9 @@ added:
35583558
- v13.0.0
35593559
- v12.16.0
35603560
- v10.22.0
3561+
napiVersion: 7
35613562
-->
35623563

3563-
> Stability: 1 - Experimental
3564-
35653564
```c
35663565
napi_status napi_detach_arraybuffer(napi_env env,
35673566
napi_value arraybuffer)
@@ -3587,10 +3586,9 @@ added:
35873586
- v13.3.0
35883587
- v12.16.0
35893588
- v10.22.0
3589+
napiVersion: 7
35903590
-->
35913591

3592-
> Stability: 1 - Experimental
3593-
35943592
```c
35953593
napi_status napi_is_detached_arraybuffer(napi_env env,
35963594
napi_value arraybuffer,

src/js_native_api.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// functions available in a new version of N-API that is not yet ported in all
1818
// LTS versions, they can set NAPI_VERSION knowing that they have specifically
1919
// depended on that version.
20-
#define NAPI_VERSION 6
20+
#define NAPI_VERSION 7
2121
#endif
2222
#endif
2323

@@ -529,14 +529,17 @@ NAPI_EXTERN napi_status napi_get_instance_data(napi_env env,
529529
void** data);
530530
#endif // NAPI_VERSION >= 6
531531

532-
#ifdef NAPI_EXPERIMENTAL
532+
#if NAPI_VERSION >= 7
533533
// ArrayBuffer detaching
534534
NAPI_EXTERN napi_status napi_detach_arraybuffer(napi_env env,
535535
napi_value arraybuffer);
536536

537537
NAPI_EXTERN napi_status napi_is_detached_arraybuffer(napi_env env,
538538
napi_value value,
539539
bool* result);
540+
#endif // NAPI_VERSION >= 7
541+
542+
#ifdef NAPI_EXPERIMENTAL
540543
// Type tagging
541544
NAPI_EXTERN napi_status napi_type_tag_object(napi_env env,
542545
napi_value value,

src/node_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@
9393

9494
// The NAPI_VERSION provided by this version of the runtime. This is the version
9595
// which the Node binary being built supports.
96-
#define NAPI_VERSION 6
96+
#define NAPI_VERSION 7
9797

9898
#endif // SRC_NODE_VERSION_H_

test/js-native-api/test_general/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ assert.notStrictEqual(test_general.testGetPrototype(baseObject),
3333
test_general.testGetPrototype(extendedObject));
3434

3535
// Test version management functions
36-
assert.strictEqual(test_general.testGetVersion(), 6);
36+
assert.strictEqual(test_general.testGetVersion(), 7);
3737

3838
[
3939
123,

test/js-native-api/test_typedarray/test_typedarray.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define NAPI_EXPERIMENTAL
21
#include <js_native_api.h>
32
#include <string.h>
43
#include <stdlib.h>

0 commit comments

Comments
 (0)