@@ -477,7 +477,7 @@ napiVersion: 6
477477-->
478478
479479```c
480- napi_status napi_set_instance_data(node_api_nogc_env env,
480+ napi_status napi_set_instance_data(node_api_basic_env env,
481481 void* data,
482482 napi_finalize finalize_cb,
483483 void* finalize_hint);
@@ -509,7 +509,7 @@ napiVersion: 6
509509-->
510510
511511```c
512- napi_status napi_get_instance_data(node_api_nogc_env env,
512+ napi_status napi_get_instance_data(node_api_basic_env env,
513513 void** data);
514514```
515515
@@ -611,16 +611,16 @@ when an instance of a native addon is unloaded. Notification of this event is
611611delivered through the callbacks given to [`napi_add_env_cleanup_hook`][] and
612612[`napi_set_instance_data`][].
613613
614- ### `node_api_nogc_env `
614+ ### `node_api_basic_env `
615615
616616> Stability: 1 - Experimental
617617
618618This variant of `napi_env` is passed to synchronous finalizers
619- ([`node_api_nogc_finalize `][]). There is a subset of Node-APIs which accept
620- a parameter of type `node_api_nogc_env ` as their first argument. These APIs do
619+ ([`node_api_basic_finalize `][]). There is a subset of Node-APIs which accept
620+ a parameter of type `node_api_basic_env ` as their first argument. These APIs do
621621not access the state of the JavaScript engine and are thus safe to call from
622622synchronous finalizers. Passing a parameter of type `napi_env` to these APIs is
623- allowed, however, passing a parameter of type `node_api_nogc_env ` to APIs that
623+ allowed, however, passing a parameter of type `node_api_basic_env ` to APIs that
624624access the JavaScript engine state is not allowed. Attempting to do so without
625625a cast will produce a compiler warning or an error when add-ons are compiled
626626with flags which cause them to emit warnings and/or errors when incorrect
@@ -791,7 +791,7 @@ typedef napi_value (*napi_callback)(napi_env, napi_callback_info);
791791Unless for reasons discussed in [Object Lifetime Management][], creating a
792792handle and/or callback scope inside a `napi_callback` is not necessary.
793793
794- #### `node_api_nogc_finalize `
794+ #### `node_api_basic_finalize `
795795
796796<!-- YAML
797797added: v20.12.0
@@ -803,11 +803,11 @@ Function pointer type for add-on provided functions that allow the user to be
803803notified when externally-owned data is ready to be cleaned up because the
804804object it was associated with has been garbage-collected. The user must provide
805805a function satisfying the following signature which would get called upon the
806- object's collection. Currently, `node_api_nogc_finalize ` can be used for
806+ object's collection. Currently, `node_api_basic_finalize ` can be used for
807807finding out when objects that have external data are collected.
808808
809809```c
810- typedef void (*node_api_nogc_finalize)(node_api_nogc_env env,
810+ typedef void (*node_api_basic_finalize)(node_api_basic_env env,
811811 void* finalize_data,
812812 void* finalize_hint);
813813```
@@ -817,7 +817,7 @@ handle and/or callback scope inside the function body is not necessary.
817817
818818Since these functions may be called while the JavaScript engine is in a state
819819where it cannot execute JavaScript code, only Node-APIs which accept a
820- `node_api_nogc_env ` as their first parameter may be called.
820+ `node_api_basic_env ` as their first parameter may be called.
821821[`node_api_post_finalizer`][] can be used to schedule Node-API calls that
822822require access to the JavaScript engine's state to run after the current
823823garbage collection cycle has completed.
@@ -831,10 +831,10 @@ Change History:
831831
832832* experimental (`NAPI_EXPERIMENTAL`):
833833
834- Only Node-API calls that accept a `node_api_nogc_env ` as their first
834+ Only Node-API calls that accept a `node_api_basic_env ` as their first
835835 parameter may be called, otherwise the application will be terminated with an
836836 appropriate error message. This feature can be turned off by defining
837- `NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT `.
837+ `NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT `.
838838
839839#### `napi_finalize`
840840
@@ -859,9 +859,9 @@ Change History:
859859* experimental (`NAPI_EXPERIMENTAL` is defined):
860860
861861 A function of this type may no longer be used as a finalizer, except with
862- [`node_api_post_finalizer`][]. [`node_api_nogc_finalize `][] must be used
862+ [`node_api_post_finalizer`][]. [`node_api_basic_finalize `][] must be used
863863 instead. This feature can be turned off by defining
864- `NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT `.
864+ `NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT `.
865865
866866#### `napi_async_execute_callback`
867867
@@ -1063,7 +1063,7 @@ napiVersion: 1
10631063
10641064```c
10651065napi_status
1066- napi_get_last_error_info(node_api_nogc_env env,
1066+ napi_get_last_error_info(node_api_basic_env env,
10671067 const napi_extended_error_info** result);
10681068```
10691069
@@ -1882,7 +1882,7 @@ napiVersion: 3
18821882-->
18831883
18841884```c
1885- NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_nogc_env env,
1885+ NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_basic_env env,
18861886 napi_cleanup_hook fun,
18871887 void* arg);
18881888```
@@ -1912,7 +1912,7 @@ napiVersion: 3
19121912-->
19131913
19141914```c
1915- NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_nogc_env env,
1915+ NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_basic_env env,
19161916 void (*fun)(void* arg),
19171917 void* arg);
19181918```
@@ -1941,7 +1941,7 @@ changes:
19411941
19421942```c
19431943NAPI_EXTERN napi_status napi_add_async_cleanup_hook(
1944- node_api_nogc_env env,
1944+ node_api_basic_env env,
19451945 napi_async_cleanup_hook hook,
19461946 void* arg,
19471947 napi_async_cleanup_hook_handle* remove_handle);
@@ -5524,7 +5524,7 @@ napiVersion: 5
55245524napi_status napi_add_finalizer(napi_env env,
55255525 napi_value js_object,
55265526 void* finalize_data,
5527- node_api_nogc_finalize finalize_cb,
5527+ node_api_basic_finalize finalize_cb,
55285528 void* finalize_hint,
55295529 napi_ref* result);
55305530```
@@ -5562,7 +5562,7 @@ added: v20.10.0
55625562> Stability: 1 - Experimental
55635563
55645564```c
5565- napi_status node_api_post_finalizer(node_api_nogc_env env,
5565+ napi_status node_api_post_finalizer(node_api_basic_env env,
55665566 napi_finalize finalize_cb,
55675567 void* finalize_data,
55685568 void* finalize_hint);
@@ -5632,7 +5632,7 @@ Once created the async worker can be queued
56325632for execution using the [`napi_queue_async_work`][] function:
56335633
56345634```c
5635- napi_status napi_queue_async_work(node_api_nogc_env env,
5635+ napi_status napi_queue_async_work(node_api_basic_env env,
56365636 napi_async_work work);
56375637```
56385638
@@ -5724,7 +5724,7 @@ napiVersion: 1
57245724-->
57255725
57265726```c
5727- napi_status napi_queue_async_work(node_api_nogc_env env,
5727+ napi_status napi_queue_async_work(node_api_basic_env env,
57285728 napi_async_work work);
57295729```
57305730
@@ -5745,7 +5745,7 @@ napiVersion: 1
57455745-->
57465746
57475747```c
5748- napi_status napi_cancel_async_work(node_api_nogc_env env,
5748+ napi_status napi_cancel_async_work(node_api_basic_env env,
57495749 napi_async_work work);
57505750```
57515751
@@ -5949,7 +5949,7 @@ typedef struct {
59495949 const char* release;
59505950} napi_node_version;
59515951
5952- napi_status napi_get_node_version(node_api_nogc_env env,
5952+ napi_status napi_get_node_version(node_api_basic_env env,
59535953 const napi_node_version** version);
59545954```
59555955
@@ -5972,7 +5972,7 @@ napiVersion: 1
59725972-->
59735973
59745974```c
5975- napi_status napi_get_version(node_api_nogc_env env,
5975+ napi_status napi_get_version(node_api_basic_env env,
59765976 uint32_t* result);
59775977```
59785978
@@ -6005,7 +6005,7 @@ napiVersion: 1
60056005-->
60066006
60076007```c
6008- NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_nogc_env env,
6008+ NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_basic_env env,
60096009 int64_t change_in_bytes,
60106010 int64_t* result);
60116011```
@@ -6222,7 +6222,7 @@ napiVersion: 2
62226222-->
62236223
62246224```c
6225- NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env,
6225+ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_basic_env env,
62266226 struct uv_loop_s** loop);
62276227```
62286228
@@ -6542,7 +6542,7 @@ napiVersion: 4
65426542
65436543```c
65446544NAPI_EXTERN napi_status
6545- napi_ref_threadsafe_function(node_api_nogc_env env, napi_threadsafe_function func);
6545+ napi_ref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);
65466546```
65476547
65486548* `[in] env`: The environment that the API is invoked under.
@@ -6568,7 +6568,7 @@ napiVersion: 4
65686568
65696569```c
65706570NAPI_EXTERN napi_status
6571- napi_unref_threadsafe_function(node_api_nogc_env env, napi_threadsafe_function func);
6571+ napi_unref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);
65726572```
65736573
65746574* `[in] env`: The environment that the API is invoked under.
@@ -6594,7 +6594,7 @@ napiVersion: 9
65946594
65956595```c
65966596NAPI_EXTERN napi_status
6597- node_api_get_module_file_name(node_api_nogc_env env, const char** result);
6597+ node_api_get_module_file_name(node_api_basic_env env, const char** result);
65986598
65996599```
66006600
@@ -6719,10 +6719,10 @@ the add-on's file name during loading.
67196719[`napi_wrap`]: #napi_wrap
67206720[`node-addon-api`]: https://github.com/nodejs/node-addon-api
67216721[`node_api.h`]: https://github.com/nodejs/node/blob/HEAD/src/node_api.h
6722+ [`node_api_basic_finalize`]: #node_api_basic_finalize
67226723[`node_api_create_external_string_latin1`]: #node_api_create_external_string_latin1
67236724[`node_api_create_external_string_utf16`]: #node_api_create_external_string_utf16
67246725[`node_api_create_syntax_error`]: #node_api_create_syntax_error
6725- [`node_api_nogc_finalize`]: #node_api_nogc_finalize
67266726[`node_api_post_finalizer`]: #node_api_post_finalizer
67276727[`node_api_throw_syntax_error`]: #node_api_throw_syntax_error
67286728[`process.release`]: process.md#processrelease
0 commit comments