@@ -81,22 +81,23 @@ To use **Node-API** in a native module:
81
81
At build time, the Node-API back-compat library code will be used only when the
82
82
targeted node version *does not* have Node-API built-in.
83
83
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.
86
87
87
88
By default, throwing an exception on a terminating environment (eg. worker
88
89
threads) will cause a fatal exception, terminating the Node process. This is to
89
90
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 .
93
94
94
95
Various Node-API constructs provide a mechanism to run a callback in response to
95
96
a garbage collection event of that object. These callbacks are called
96
97
[_finalizers_ ]. Some finalizers have restrictions on the type of Node-APIs
97
98
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 .
101
102
102
103
[_finalizers_ ]: ./finalization.md
0 commit comments