diff --git a/native/cocos/bindings/jswrapper/jsvm/Object.cpp b/native/cocos/bindings/jswrapper/jsvm/Object.cpp index 49686ce104..f6c6c9ad16 100644 --- a/native/cocos/bindings/jswrapper/jsvm/Object.cpp +++ b/native/cocos/bindings/jswrapper/jsvm/Object.cpp @@ -121,11 +121,6 @@ void Object::setPrivateObject(PrivateObjectBase* data) { // WORKAROUND: See the explain in `ObjectRef::deleteRef` about why we need to `decRef` here. _objRef.decRef(_env); // - - - //_objRef.setWeakref(_env, result); - setProperty("__native_ptr__", se::Value(static_cast(reinterpret_cast(data)))); - return; } bool Object::deleteProperty(const char* name) { @@ -578,22 +573,6 @@ void Object::_setFinalizeCallback(JSVM_Finalize finalizeCb) { _finalizeCb = finalizeCb; } -// void Object::setPrivateData(void* data){ -// assert(_privateData == nullptr); -// assert(NativePtrToObjectMap::find(data) == NativePtrToObjectMap::end()); -// JSVM_Status status; -// NativePtrToObjectMap::emplace(data, this); -// _privateData = data; -// //issue https://github.com/nodejs/node/issues/23999 -// auto tmpThis = _objRef.getValue(_env); -// //_objRef.deleteRef(); -// NODE_API_CALL(status, _env, -// OH_JSVM_Wrap(_env, tmpThis, data, sendWeakCallback, -// (void*)this /* finalize_hint */, nullptr)); -// //_objRef.setWeakref(_env, result); -// setProperty("__native_ptr__", se::Value(static_cast(reinterpret_cast(data)))); -// } - void* Object::getPrivateData() const { return _privateData; } @@ -811,6 +790,7 @@ Object* Object::createProxyTarget(se::Object* proxy) { // v8::Local jsobj = proxy->getProxyTarget().As(); // Object *obj = Object::_createJSObject(nullptr, jsobj); // return obj; + assert(false); // NOT SUPPORTED NOW. return nullptr; } diff --git a/native/cocos/bindings/jswrapper/napi/Object.cpp b/native/cocos/bindings/jswrapper/napi/Object.cpp index 3bb98f596d..b8d8ec34d7 100644 --- a/native/cocos/bindings/jswrapper/napi/Object.cpp +++ b/native/cocos/bindings/jswrapper/napi/Object.cpp @@ -123,6 +123,7 @@ Object* Object::createProxyTarget(se::Object* proxy) { // v8::Local jsobj = proxy->getProxyTarget().As(); // Object *obj = Object::_createJSObject(nullptr, jsobj); // return obj; + assert(false); return nullptr; } @@ -529,10 +530,6 @@ void Object::setPrivateObject(PrivateObjectBase* data) { NODE_API_CALL(status, _env, napi_wrap(_env, tmpThis, this, weakCallback, (void*)this /* finalize_hint */, &result)); - //_objRef.setWeakref(_env, result); - setProperty("__native_ptr__", se::Value(static_cast(reinterpret_cast(data)))); - - return; } bool Object::attachObject(Object* obj) {