diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index 9c0f2b56c26d60..fe3d8fbc977c2e 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -627,9 +627,6 @@ v8::Local Reference::Get() { } void Reference::Finalize(bool is_env_teardown) { - if (is_env_teardown) env_teardown_finalize_started_ = true; - if (!is_env_teardown && env_teardown_finalize_started_) return; - // During env teardown, `~napi_env()` alone is responsible for finalizing. // Thus, we don't want any stray gc passes to trigger a second call to // `RefBase::Finalize()`. ClearWeak will ensure that even if the diff --git a/src/js_native_api_v8.h b/src/js_native_api_v8.h index 057113f2cb7549..91c2eeb98989ca 100644 --- a/src/js_native_api_v8.h +++ b/src/js_native_api_v8.h @@ -433,7 +433,6 @@ class Reference : public RefBase { static void SecondPassCallback( const v8::WeakCallbackInfo& data); - bool env_teardown_finalize_started_ = false; v8impl::Persistent _persistent; SecondPassCallParameterRef* _secondPassParameter; bool _secondPassScheduled;