diff --git a/src/env.cc b/src/env.cc index 6a70bcdca4ae1c..3ad13dd94a0954 100644 --- a/src/env.cc +++ b/src/env.cc @@ -964,6 +964,8 @@ uv_key_t Environment::thread_local_env = {}; void Environment::Exit(int exit_code) { if (options()->trace_exit) { HandleScope handle_scope(isolate()); + Isolate::DisallowJavascriptExecutionScope disallow_js( + isolate(), Isolate::DisallowJavascriptExecutionScope::CRASH_ON_FAILURE); if (is_main_thread()) { fprintf(stderr, "(node:%d) ", uv_os_getpid());