Skip to content

Commit df4e6b1

Browse files
KevinEadylegendecas
andcommitted
Address review comments
Co-authored-by: Chengzhong Wu <[email protected]>
1 parent 1e1e05e commit df4e6b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

napi-inl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ inline void WrapVoidCallback(napi_env, Callable callback) {
150150
}
151151
#endif // NODE_ADDON_API_CPP_EXCEPTIONS_ALL
152152
#else
153-
// When C++ exceptions are disabled, errors are immediately thrown as JS
154-
// exceptions, so there is no need to catch and rethrow them here.
153+
// When C++ exceptions are disabled, there is no need to catch and rethrow C++
154+
// exceptions. JS errors should be thrown with
155+
// `Error::ThrowAsJavaScriptException`.
155156
callback();
156157
#endif // NODE_ADDON_API_CPP_EXCEPTIONS
157158
}

0 commit comments

Comments
 (0)