@@ -34,11 +34,12 @@ class BufferFinalizer: private Finalizer {
34
34
static void FinalizeBufferCallback (char * data, void * hint) {
35
35
BufferFinalizer* finalizer = static_cast <BufferFinalizer*>(hint);
36
36
if (finalizer->_finalize_callback != nullptr ) {
37
- NAPI_CALL_INTO_MODULE_THROW (finalizer->_env ,
37
+ NapiCallIntoModuleThrow (finalizer->_env , [&]() {
38
38
finalizer->_finalize_callback (
39
39
finalizer->_env ,
40
40
data,
41
- finalizer->_finalize_hint ));
41
+ finalizer->_finalize_hint );
42
+ });
42
43
}
43
44
44
45
Delete (finalizer);
@@ -465,8 +466,9 @@ void napi_module_register_by_symbol(v8::Local<v8::Object> exports,
465
466
napi_env env = v8impl::GetEnv (context);
466
467
467
468
napi_value _exports;
468
- NAPI_CALL_INTO_MODULE_THROW (env,
469
- _exports = init (env, v8impl::JsValueFromV8LocalValue (exports)));
469
+ NapiCallIntoModuleThrow (env, [&]() {
470
+ _exports = init (env, v8impl::JsValueFromV8LocalValue (exports));
471
+ });
470
472
471
473
// If register function returned a non-null exports object different from
472
474
// the exports object we passed it, set that as the "exports" property of
@@ -874,14 +876,14 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork {
874
876
// stored.
875
877
napi_env env = _env;
876
878
877
- NAPI_CALL_INTO_MODULE (env,
878
- _complete (_env, ConvertUVErrorCode (status), _data),
879
- [env] (v8::Local<v8::Value> local_err) {
880
- // If there was an unhandled exception in the complete callback,
881
- // report it as a fatal exception. (There is no JavaScript on the
882
- // callstack that can possibly handle it.)
883
- v8impl::trigger_fatal_exception (env, local_err);
884
- });
879
+ NapiCallIntoModule (env, [&]() {
880
+ _complete (_env, ConvertUVErrorCode (status), _data);
881
+ }, [env](v8::Local<v8::Value> local_err) {
882
+ // If there was an unhandled exception in the complete callback,
883
+ // report it as a fatal exception. (There is no JavaScript on the
884
+ // callstack that can possibly handle it.)
885
+ v8impl::trigger_fatal_exception (env, local_err);
886
+ });
885
887
886
888
// Note: Don't access `work` after this point because it was
887
889
// likely deleted by the complete callback.
0 commit comments