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 6cdd7d78a692481fe29c3db4cc443f18738f146c..109c9207b70d378cc10205d0d226272144e5e391 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 71209efa71d4d404abc5e9305671b92f6cdcb1b6..9f85b60c1bef4fe0871c4a0b74975606327f9da8 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 93a9c013eda78ac6cc02a60b49cd3e6dec28a128..8d5f0ca7d3aa3adea69824b84b16ca8fd7500fd4 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; }