From 5c473bdc12b35546e3b03b47c70ae14fff90536b Mon Sep 17 00:00:00 2001 From: legendecas Date: Thu, 22 Apr 2021 01:07:24 +0800 Subject: [PATCH] src: remove unused guards around node-api reference PR-URL: https://github.com/nodejs/node/pull/38334 Reviewed-By: Michael Dawson --- src/js_native_api_v8.cc | 3 --- src/js_native_api_v8.h | 1 - 2 files changed, 4 deletions(-) diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index eda1f516624f53..703c6bcc2c3898 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;