From 15c978da5208acecb3384383bf7e3f4a990b7cfc Mon Sep 17 00:00:00 2001 From: zhangxinyu Date: Wed, 3 Sep 2025 15:43:40 +0800 Subject: [PATCH] Interop removes duplicate sharedreference Interop removes duplicate sharedreference Issue:ICW6CY Signed-off-by: zhangxinyu --- static_core/plugins/ets/runtime/interop_js/js_convert.h | 2 +- static_core/plugins/ets/runtime/interop_js/js_value.h | 2 +- .../test_proxy_reference_storage_3.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static_core/plugins/ets/runtime/interop_js/js_convert.h b/static_core/plugins/ets/runtime/interop_js/js_convert.h index 6cdd7d78a6..109c9207b7 100644 --- a/static_core/plugins/ets/runtime/interop_js/js_convert.h +++ b/static_core/plugins/ets/runtime/interop_js/js_convert.h @@ -414,7 +414,7 @@ JSCONVERT_UNWRAP(Promise) EtsHandle href(coro, EtsPromiseRef::Create(coro)); href->SetTarget(coro, hpromise->AsObject()); hpromise->SetInteropObject(coro, href.GetPtr()); - storage->CreateJSObjectRef(ctx, href.GetPtr(), jsVal); + storage->CreateJSObjectRefwithWrap(ctx, href.GetPtr(), jsVal); hpromise->SetLinkedPromise(coro, href->AsObject()); EtsPromise::CreateLink(hpromise->GetLinkedPromise(coro), hpromise.GetPtr()); return hpromise.GetPtr(); diff --git a/static_core/plugins/ets/runtime/interop_js/js_value.h b/static_core/plugins/ets/runtime/interop_js/js_value.h index 71209efa71..9f85b60c1b 100644 --- a/static_core/plugins/ets/runtime/interop_js/js_value.h +++ b/static_core/plugins/ets/runtime/interop_js/js_value.h @@ -344,7 +344,7 @@ private: ASSERT(GetValueType(ctx->GetJSEnv(), jsValue) == type); ASSERT(IsRefType(type)); SetType(type); - SetData(ctx->GetSharedRefStorage()->CreateJSObjectRef(ctx, this, jsValue)); + SetData(ctx->GetSharedRefStorage()->CreateJSObjectRefwithWrap(ctx, this, jsValue)); } FIELD_UNUSED uint32_t type_; diff --git a/static_core/plugins/ets/tests/interop_js/tests/proxies/mem/proxy_reference_storage_3/test_proxy_reference_storage_3.cpp b/static_core/plugins/ets/tests/interop_js/tests/proxies/mem/proxy_reference_storage_3/test_proxy_reference_storage_3.cpp index 93a9c013ed..8d5f0ca7d3 100644 --- a/static_core/plugins/ets/tests/interop_js/tests/proxies/mem/proxy_reference_storage_3/test_proxy_reference_storage_3.cpp +++ b/static_core/plugins/ets/tests/interop_js/tests/proxies/mem/proxy_reference_storage_3/test_proxy_reference_storage_3.cpp @@ -119,7 +119,7 @@ public: SharedReference *CreateReference(EtsObject *etsObject, napi_value &jsObj) { NAPI_CHECK_FATAL(napi_create_object(InteropCtx::Current()->GetJSEnv(), &jsObj)); - SharedReference *ref = storage_->CreateJSObjectRef(InteropCtx::Current(), etsObject, jsObj); + SharedReference *ref = storage_->CreateJSObjectRefwithWrap(InteropCtx::Current(), etsObject, jsObj); return ref; } -- Gitee