diff --git a/src/env.cc b/src/env.cc index 0581d9273d6da7..52618f2033b76c 100644 --- a/src/env.cc +++ b/src/env.cc @@ -950,6 +950,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());