@@ -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:
@@ -806,11 +806,11 @@ Function pointer type for add-on provided functions that allow the user to be
806806notified when externally-owned data is ready to be cleaned up because the
807807object it was associated with has been garbage-collected. The user must provide
808808a function satisfying the following signature which would get called upon the
809- object's collection. Currently, `node_api_nogc_finalize ` can be used for
809+ object's collection. Currently, `node_api_basic_finalize ` can be used for
810810finding out when objects that have external data are collected.
811811
812812```c
813- typedef void (*node_api_nogc_finalize)(node_api_nogc_env env,
813+ typedef void (*node_api_basic_finalize)(node_api_basic_env env,
814814 void* finalize_data,
815815 void* finalize_hint);
816816```
@@ -820,7 +820,7 @@ handle and/or callback scope inside the function body is not necessary.
820820
821821Since these functions may be called while the JavaScript engine is in a state
822822where it cannot execute JavaScript code, only Node-APIs which accept a
823- `node_api_nogc_env ` as their first parameter may be called.
823+ `node_api_basic_env ` as their first parameter may be called.
824824[`node_api_post_finalizer`][] can be used to schedule Node-API calls that
825825require access to the JavaScript engine's state to run after the current
826826garbage collection cycle has completed.
@@ -834,10 +834,10 @@ Change History:
834834
835835* experimental (`NAPI_EXPERIMENTAL`):
836836
837- Only Node-API calls that accept a `node_api_nogc_env ` as their first
837+ Only Node-API calls that accept a `node_api_basic_env ` as their first
838838 parameter may be called, otherwise the application will be terminated with an
839839 appropriate error message. This feature can be turned off by defining
840- `NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT `.
840+ `NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT `.
841841
842842#### `napi_finalize`
843843
@@ -862,9 +862,9 @@ Change History:
862862* experimental (`NAPI_EXPERIMENTAL` is defined):
863863
864864 A function of this type may no longer be used as a finalizer, except with
865- [`node_api_post_finalizer`][]. [`node_api_nogc_finalize `][] must be used
865+ [`node_api_post_finalizer`][]. [`node_api_basic_finalize `][] must be used
866866 instead. This feature can be turned off by defining
867- `NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT `.
867+ `NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT `.
868868
869869#### `napi_async_execute_callback`
870870
@@ -1066,7 +1066,7 @@ napiVersion: 1
10661066
10671067```c
10681068napi_status
1069- napi_get_last_error_info(node_api_nogc_env env,
1069+ napi_get_last_error_info(node_api_basic_env env,
10701070 const napi_extended_error_info** result);
10711071```
10721072
@@ -1885,7 +1885,7 @@ napiVersion: 3
18851885-->
18861886
18871887```c
1888- NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_nogc_env env,
1888+ NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_basic_env env,
18891889 napi_cleanup_hook fun,
18901890 void* arg);
18911891```
@@ -1915,7 +1915,7 @@ napiVersion: 3
19151915-->
19161916
19171917```c
1918- NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_nogc_env env,
1918+ NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_basic_env env,
19191919 void (*fun)(void* arg),
19201920 void* arg);
19211921```
@@ -1944,7 +1944,7 @@ changes:
19441944
19451945```c
19461946NAPI_EXTERN napi_status napi_add_async_cleanup_hook(
1947- node_api_nogc_env env,
1947+ node_api_basic_env env,
19481948 napi_async_cleanup_hook hook,
19491949 void* arg,
19501950 napi_async_cleanup_hook_handle* remove_handle);
@@ -5533,7 +5533,7 @@ napiVersion: 5
55335533napi_status napi_add_finalizer(napi_env env,
55345534 napi_value js_object,
55355535 void* finalize_data,
5536- node_api_nogc_finalize finalize_cb,
5536+ node_api_basic_finalize finalize_cb,
55375537 void* finalize_hint,
55385538 napi_ref* result);
55395539```
@@ -5574,7 +5574,7 @@ added:
55745574> Stability: 1 - Experimental
55755575
55765576```c
5577- napi_status node_api_post_finalizer(node_api_nogc_env env,
5577+ napi_status node_api_post_finalizer(node_api_basic_env env,
55785578 napi_finalize finalize_cb,
55795579 void* finalize_data,
55805580 void* finalize_hint);
@@ -5644,7 +5644,7 @@ Once created the async worker can be queued
56445644for execution using the [`napi_queue_async_work`][] function:
56455645
56465646```c
5647- napi_status napi_queue_async_work(node_api_nogc_env env,
5647+ napi_status napi_queue_async_work(node_api_basic_env env,
56485648 napi_async_work work);
56495649```
56505650
@@ -5736,7 +5736,7 @@ napiVersion: 1
57365736-->
57375737
57385738```c
5739- napi_status napi_queue_async_work(node_api_nogc_env env,
5739+ napi_status napi_queue_async_work(node_api_basic_env env,
57405740 napi_async_work work);
57415741```
57425742
@@ -5757,7 +5757,7 @@ napiVersion: 1
57575757-->
57585758
57595759```c
5760- napi_status napi_cancel_async_work(node_api_nogc_env env,
5760+ napi_status napi_cancel_async_work(node_api_basic_env env,
57615761 napi_async_work work);
57625762```
57635763
@@ -5961,7 +5961,7 @@ typedef struct {
59615961 const char* release;
59625962} napi_node_version;
59635963
5964- napi_status napi_get_node_version(node_api_nogc_env env,
5964+ napi_status napi_get_node_version(node_api_basic_env env,
59655965 const napi_node_version** version);
59665966```
59675967
@@ -5984,7 +5984,7 @@ napiVersion: 1
59845984-->
59855985
59865986```c
5987- napi_status napi_get_version(node_api_nogc_env env,
5987+ napi_status napi_get_version(node_api_basic_env env,
59885988 uint32_t* result);
59895989```
59905990
@@ -6017,7 +6017,7 @@ napiVersion: 1
60176017-->
60186018
60196019```c
6020- NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_nogc_env env,
6020+ NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_basic_env env,
60216021 int64_t change_in_bytes,
60226022 int64_t* result);
60236023```
@@ -6234,7 +6234,7 @@ napiVersion: 2
62346234-->
62356235
62366236```c
6237- NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env,
6237+ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_basic_env env,
62386238 struct uv_loop_s** loop);
62396239```
62406240
@@ -6554,7 +6554,7 @@ napiVersion: 4
65546554
65556555```c
65566556NAPI_EXTERN napi_status
6557- napi_ref_threadsafe_function(node_api_nogc_env env, napi_threadsafe_function func);
6557+ napi_ref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);
65586558```
65596559
65606560* `[in] env`: The environment that the API is invoked under.
@@ -6580,7 +6580,7 @@ napiVersion: 4
65806580
65816581```c
65826582NAPI_EXTERN napi_status
6583- napi_unref_threadsafe_function(node_api_nogc_env env, napi_threadsafe_function func);
6583+ napi_unref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);
65846584```
65856585
65866586* `[in] env`: The environment that the API is invoked under.
@@ -6606,7 +6606,7 @@ napiVersion: 9
66066606
66076607```c
66086608NAPI_EXTERN napi_status
6609- node_api_get_module_file_name(node_api_nogc_env env, const char** result);
6609+ node_api_get_module_file_name(node_api_basic_env env, const char** result);
66106610
66116611```
66126612
@@ -6731,10 +6731,10 @@ the add-on's file name during loading.
67316731[`napi_wrap`]: #napi_wrap
67326732[`node-addon-api`]: https://github.com/nodejs/node-addon-api
67336733[`node_api.h`]: https://github.com/nodejs/node/blob/HEAD/src/node_api.h
6734+ [`node_api_basic_finalize`]: #node_api_basic_finalize
67346735[`node_api_create_external_string_latin1`]: #node_api_create_external_string_latin1
67356736[`node_api_create_external_string_utf16`]: #node_api_create_external_string_utf16
67366737[`node_api_create_syntax_error`]: #node_api_create_syntax_error
6737- [`node_api_nogc_finalize`]: #node_api_nogc_finalize
67386738[`node_api_post_finalizer`]: #node_api_post_finalizer
67396739[`node_api_throw_syntax_error`]: #node_api_throw_syntax_error
67406740[`process.release`]: process.md#processrelease
0 commit comments