Skip to content

Commit 23b57cc

Browse files
committed
Address review comments
- Use passive voice in existing and new docs - Revert unnecessary change
1 parent 7c91a10 commit 23b57cc

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

doc/finalization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ provide more efficient memory management, optimizations, improved execution, or
88
other benefits.
99

1010
In general, it is best to use basic finalizers whenever possible (eg. when
11-
access to JavaScript is _not_ needed). To ensure that all finalizers are basic
12-
finalizers at compile-time, define the `NODE_ADDON_API_REQUIRE_BASIC_FINALIZERS`
13-
preprocessor directive.
11+
access to JavaScript is _not_ needed). The
12+
`NODE_ADDON_API_REQUIRE_BASIC_FINALIZERS` preprocessor directive can be defined
13+
to ensure that all finalizers are basic.
1414

1515
## Finalizers
1616

doc/setup.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,23 @@ To use **Node-API** in a native module:
8181
At build time, the Node-API back-compat library code will be used only when the
8282
targeted node version *does not* have Node-API built-in.
8383

84-
The preprocessor directive `NODE_ADDON_API_DISABLE_DEPRECATED` can be defined at
85-
compile time before including `napi.h` to skip the definition of deprecated APIs.
84+
The `NODE_ADDON_API_DISABLE_DEPRECATED` preprocessor directive can be defined at
85+
compile time before including `napi.h` to skip the definition of deprecated
86+
APIs.
8687

8788
By default, throwing an exception on a terminating environment (eg. worker
8889
threads) will cause a fatal exception, terminating the Node process. This is to
8990
provide feedback to the user of the runtime error, as it is impossible to pass
90-
the error to JavaScript when the environment is terminating. In order to bypass
91-
this behavior such that the Node process will not terminate, define the
92-
preprocessor directive `NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS`.
91+
the error to JavaScript when the environment is terminating. The
92+
`NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS` preprocessor directive can be defined
93+
to bypass this behavior, such that the Node process will not terminate.
9394

9495
Various Node-API constructs provide a mechanism to run a callback in response to
9596
a garbage collection event of that object. These callbacks are called
9697
[_finalizers_]. Some finalizers have restrictions on the type of Node-APIs
9798
available within the callback. node-addon-api provides convenience helpers that
98-
bypass this limitation, but may cause the add-on to run less efficiently. To
99-
disable the convenience helpers, define the preprocessor directive
100-
`NODE_ADDON_API_REQUIRE_BASIC_FINALIZERS`.
99+
bypass this limitation, but may cause the add-on to run less efficiently. The
100+
`NODE_ADDON_API_REQUIRE_BASIC_FINALIZERS` preprocessor directive can be defined
101+
to disable the convenience helpers.
101102

102103
[_finalizers_]: ./finalization.md

napi-inl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ struct FinalizeData {
205205
});
206206
}
207207

208-
#if defined(NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER)
208+
#ifdef NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER
209209
template <typename F = Finalizer,
210210
typename = std::enable_if_t<
211211
!std::is_invocable_v<F, node_api_nogc_env, T*>>,
@@ -240,7 +240,7 @@ struct FinalizeData {
240240
});
241241
}
242242

243-
#if defined(NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER)
243+
#ifdef NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER
244244
template <typename F = Finalizer,
245245
typename = std::enable_if_t<
246246
!std::is_invocable_v<F, node_api_nogc_env, T*, Hint*>>,

0 commit comments

Comments
 (0)