mirror of
https://gitee.com/openharmony/interface_sdk_c
synced 2025-02-17 07:21:10 +00:00
add create env api
Signed-off-by: zhuhan <zhuhan10@huawei.com> Change-Id: I5de6fd308000650f60cb872287726a5beacfe52d
This commit is contained in:
parent
05fb411f3e
commit
5f28296047
@ -154,5 +154,13 @@
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "napi_make_callback"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "napi_create_ark_runtime"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "napi_destroy_ark_runtime"
|
||||
}
|
||||
]
|
||||
|
@ -127,6 +127,21 @@ NAPI_EXTERN napi_status napi_add_finalizer(napi_env env,
|
||||
napi_finalize finalize_cb,
|
||||
void* finalize_hint,
|
||||
napi_ref* result);
|
||||
/**
|
||||
* @brief Create the ark runtime.
|
||||
*
|
||||
* @param env Indicates the ark runtime environment.
|
||||
* @since 12
|
||||
*/
|
||||
NAPI_EXTERN napi_status napi_create_ark_runtime(napi_env* env);
|
||||
|
||||
/**
|
||||
* @brief Destroy the ark runtime.
|
||||
*
|
||||
* @param env Indicates the ark runtime environment.
|
||||
* @since 12
|
||||
*/
|
||||
NAPI_EXTERN napi_status napi_destroy_ark_runtime(napi_env* env);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
8
third_party/node/src/js_native_api_types.h
vendored
8
third_party/node/src/js_native_api_types.h
vendored
@ -92,7 +92,13 @@ typedef enum {
|
||||
napi_date_expected,
|
||||
napi_arraybuffer_expected,
|
||||
napi_detachable_arraybuffer_expected,
|
||||
napi_would_deadlock // unused
|
||||
napi_would_deadlock, // unused
|
||||
// Created too many ark runtime environment, up to 16.
|
||||
napi_create_ark_runtime_too_many_envs = 22,
|
||||
// Only one ark runtime environment can be created per thread.
|
||||
napi_create_ark_runtime_only_one_env_per_thread = 23,
|
||||
// The ark runtime environment to be destroyed does not exist.
|
||||
napi_destroy_ark_runtime_env_not_exist = 24
|
||||
} napi_status;
|
||||
// Note: when adding a new enum value to `napi_status`, please also update
|
||||
// * `const int last_status` in the definition of `napi_get_last_error_info()'
|
||||
|
Loading…
x
Reference in New Issue
Block a user