Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! TSFN fatal uncaught exception handling
  • Loading branch information
gabrielschulhof committed Dec 25, 2024
commit e9de692b3e1e7ae28ecad537eb595429c1312bad
4 changes: 2 additions & 2 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ will not be freed. This can be avoided by calling

**Change History:**

* Experimental (`NAPI_EXPERIMENTAL` is defined):
* Version 10 (`NAPI_VERSION` is defined as `10` or higher):

References can be created for all value types. The new supported value
types do not support weak reference semantic and the values of these types
Expand Down Expand Up @@ -6527,7 +6527,7 @@ napi_create_threadsafe_function(napi_env env,

**Change History:**

* Experimental (`NAPI_EXPERIMENTAL` is defined):
* Version 10 (`NAPI_VERSION` is defined as `10` or higher):

Uncaught exceptions thrown in `call_js_cb` are handled with the
[`'uncaughtException'`][] event, instead of being ignored.
Expand Down
10 changes: 5 additions & 5 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ void node_napi_env__::CallbackIntoModule(T&& call) {
return;
}
node::Environment* node_env = env->node_env();
// If the module api version is less than NAPI_VERSION_EXPERIMENTAL,
// and the option --force-node-api-uncaught-exceptions-policy is not
// specified, emit a warning about the uncaught exception instead of
// triggering uncaught exception event.
if (env->module_api_version < NAPI_VERSION_EXPERIMENTAL &&
// If the module api version is less than 10, and the option
// --force-node-api-uncaught-exceptions-policy is not specified, emit a
// warning about the uncaught exception instead of triggering the uncaught
// exception event.
if (env->module_api_version < 10 &&
!node_env->options()->force_node_api_uncaught_exceptions_policy &&
!enforceUncaughtExceptionPolicy) {
ProcessEmitDeprecationWarning(
Expand Down