node-api: define version 8

Mark as stable the APIs that define Node-API version 8.

PR-URL: https://github.com/nodejs/node/pull/37652
Backport-PR-URL: https://github.com/nodejs/node/pull/37728
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Gabriel Schulhof authored and Michaël Zasso committed 2021-04-25 07:18:11 +02:00
1 parent cd1da67295
commit 36abc1802c
9 files changed
+37 -33

No files matched your search

+24 -18
View File
@@ -686,7 +686,10 @@ For more details, review the [Object lifetime management][].
#### napi_type_tag
<!-- YAML
added: v14.8.0
added:
- v14.8.0
- v12.19.0
napiVersion: 8
-->
A 128-bit value stored as two unsigned 64-bit integers. It serves as a UUID
@@ -1694,15 +1697,16 @@ with `napi_add_env_cleanup_hook`, otherwise the process will abort.
#### napi_add_async_cleanup_hook
<!-- YAML
added: v14.8.0
added:
- v14.8.0
- v12.19.0
napiVersion: 8
changes:
- version: v14.10.0
pr-url: https://github.com/nodejs/node/pull/34819
description: Changed signature of the `hook` callback.
-->
> Stability: 1 - Experimental
```c
NAPI_EXTERN napi_status napi_add_async_cleanup_hook(
napi_env env,
@@ -1740,8 +1744,6 @@ changes:
description: Removed `env` parameter.
-->
> Stability: 1 - Experimental
```c
NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(
napi_async_cleanup_hook_handle remove_handle);
@@ -4196,11 +4198,12 @@ specification).
#### napi_object_freeze
<!-- YAML
added: v14.14.0
added:
- v14.14.0
- v12.20.0
napiVersion: 8
-->
> Stability: 1 - Experimental
```c
napi_status napi_object_freeze(napi_env env,
napi_value object);
@@ -4221,11 +4224,12 @@ ECMA-262 specification.
#### napi_object_seal
<!-- YAML
added: v14.14.0
added:
- v14.14.0
- v12.20.0
napiVersion: 8
-->
> Stability: 1 - Experimental
```c
napi_status napi_object_seal(napi_env env,
napi_value object);
@@ -4884,11 +4888,12 @@ JavaScript object becomes garbage-collected.
### napi_type_tag_object
<!-- YAML
added: v14.8.0
added:
- v14.8.0
- v12.19.0
napiVersion: 8
-->
> Stability: 1 - Experimental
```c
napi_status napi_type_tag_object(napi_env env,
napi_value js_object,
@@ -4911,11 +4916,12 @@ If the object already has an associated type tag, this API will return
### napi_check_object_type_tag
<!-- YAML
added: v14.8.0
added:
- v14.8.0
- v12.19.0
napiVersion: 8
-->
> Stability: 1 - Experimental
```c
napi_status napi_check_object_type_tag(napi_env env,
napi_value js_object,
+3 -3
View File
@@ -17,7 +17,7 @@
// 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 7
#define NAPI_VERSION 8
#endif
#endif
@@ -539,7 +539,7 @@ NAPI_EXTERN napi_status napi_is_detached_arraybuffer(napi_env env,
bool* result);
#endif // NAPI_VERSION >= 7
#ifdef NAPI_EXPERIMENTAL
#if NAPI_VERSION >= 8
// Type tagging
NAPI_EXTERN napi_status napi_type_tag_object(napi_env env,
napi_value value,
@@ -554,7 +554,7 @@ NAPI_EXTERN napi_status napi_object_freeze(napi_env env,
napi_value object);
NAPI_EXTERN napi_status napi_object_seal(napi_env env,
napi_value object);
#endif // NAPI_EXPERIMENTAL
#endif // NAPI_VERSION >= 8
EXTERN_C_END
+4 -4
View File
@@ -31,7 +31,7 @@ typedef enum {
// from instance properties. Ignored by napi_define_properties.
napi_static = 1 << 10,
#ifdef NAPI_EXPERIMENTAL
#if NAPI_VERSION >= 8
// Default for class methods.
napi_default_method = napi_writable | napi_configurable,
@@ -39,7 +39,7 @@ typedef enum {
napi_default_jsproperty = napi_writable |
napi_enumerable |
napi_configurable,
#endif // NAPI_EXPERIMENTAL
#endif // NAPI_VERSION >= 8
} napi_property_attributes;
typedef enum {
@@ -150,11 +150,11 @@ typedef enum {
} napi_key_conversion;
#endif // NAPI_VERSION >= 6
#ifdef NAPI_EXPERIMENTAL
#if NAPI_VERSION >= 8
typedef struct {
uint64_t lower;
uint64_t upper;
} napi_type_tag;
#endif // NAPI_EXPERIMENTAL
#endif // NAPI_VERSION >= 8
#endif // SRC_JS_NATIVE_API_TYPES_H_
+2 -2
View File
@@ -250,7 +250,7 @@ napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func);
#endif // NAPI_VERSION >= 4
#ifdef NAPI_EXPERIMENTAL
#if NAPI_VERSION >= 8
NAPI_EXTERN napi_status napi_add_async_cleanup_hook(
napi_env env,
@@ -261,7 +261,7 @@ NAPI_EXTERN napi_status napi_add_async_cleanup_hook(
NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(
napi_async_cleanup_hook_handle remove_handle);
#endif // NAPI_EXPERIMENTAL
#endif // NAPI_VERSION >= 8
EXTERN_C_END
+2 -2
View File
@@ -41,10 +41,10 @@ typedef struct {
const char* release;
} napi_node_version;
#ifdef NAPI_EXPERIMENTAL
#if NAPI_VERSION >= 8
typedef struct napi_async_cleanup_hook_handle__* napi_async_cleanup_hook_handle;
typedef void (*napi_async_cleanup_hook)(napi_async_cleanup_hook_handle handle,
void* data);
#endif // NAPI_EXPERIMENTAL
#endif // NAPI_VERSION >= 8
#endif // SRC_NODE_API_TYPES_H_
+1 -1
View File
@@ -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 7
#define NAPI_VERSION 8
#endif // SRC_NODE_VERSION_H_
+1 -1
View File
@@ -33,7 +33,7 @@ assert.notStrictEqual(test_general.testGetPrototype(baseObject),
test_general.testGetPrototype(extendedObject));
// Test version management functions
assert.strictEqual(test_general.testGetVersion(), 7);
assert.strictEqual(test_general.testGetVersion(), 8);
[
123,
@@ -1,4 +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 "assert.h"
#include "uv.h"