Skip to content

Commit b9d0f73

Browse files
Gabriel Schulhofaddaleax
Gabriel Schulhof
authored andcommittedSep 28, 2020
n-api: create N-API version 7
Mark `napi_detach_arraybuffer` and `napi_is_detached_arraybuffer` as stable. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: nodejs/node#35199 Backport-PR-URL: nodejs/node#35337 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <mdawson@devrus.com>
1 parent 2f67e99 commit b9d0f73

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed
 

‎doc/api/n-api.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -3455,10 +3455,9 @@ defined in [Section 7.2.14][] of the ECMAScript Language Specification.
34553455
### napi_detach_arraybuffer
34563456
<!-- YAML
34573457
added: v12.16.0
3458+
napiVersion: 7
34583459
-->
34593460

3460-
> Stability: 1 - Experimental
3461-
34623461
```c
34633462
napi_status napi_detach_arraybuffer(napi_env env,
34643463
napi_value arraybuffer)
@@ -3481,10 +3480,9 @@ defined in [Section 24.1.1.3][] of the ECMAScript Language Specification.
34813480
### napi_is_detached_arraybuffer
34823481
<!-- YAML
34833482
added: v12.16.0
3483+
napiVersion: 7
34843484
-->
34853485

3486-
> Stability: 1 - Experimental
3487-
34883486
```c
34893487
napi_status napi_is_detached_arraybuffer(napi_env env,
34903488
napi_value arraybuffer,

‎src/js_native_api.h

+5-2
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

+1-1
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

+1-1
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

-1
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 "../common.h"

0 commit comments

Comments
 (0)
Failed to load comments.