int FXJS_GetObjDefnID(v8::Local<v8::Object> pObj) { if (pObj.IsEmpty() || !pObj->InternalFieldCount()) return -1; CFXJS_PerObjectData* pPerObjectData = static_cast<CFXJS_PerObjectData*>( pObj->GetAlignedPointerFromInternalField(0)); if (pPerObjectData) return pPerObjectData->m_ObjDefID; return -1; }
void CFXJS_Engine::SetObjectPrivate(v8::Local<v8::Object> pObj, void* p) { if (pObj.IsEmpty() || !pObj->InternalFieldCount()) return; CFXJS_PerObjectData* pPerObjectData = static_cast<CFXJS_PerObjectData*>( pObj->GetAlignedPointerFromInternalField(0)); if (!pPerObjectData) return; pPerObjectData->m_pPrivate = p; }
int FXJS_GetObjDefnID(v8::Local<v8::Object> pObj) { if (pObj.IsEmpty() || !pObj->InternalFieldCount()) return -1; CFXJS_PrivateData* pPrivateData = (CFXJS_PrivateData*)pObj->GetAlignedPointerFromInternalField(0); if (pPrivateData) return pPrivateData->ObjDefID; return -1; }
void FXJS_SetPrivate(v8::Isolate* pIsolate, v8::Local<v8::Object> pObj, void* p) { if (pObj.IsEmpty() || !pObj->InternalFieldCount()) return; CFXJS_PrivateData* pPrivateData = (CFXJS_PrivateData*)pObj->GetAlignedPointerFromInternalField(0); if (!pPrivateData) return; pPrivateData->pPrivate = p; }
void FXJS_FreePrivate(v8::Local<v8::Object> pObj) { if (pObj.IsEmpty() || !pObj->InternalFieldCount()) return; FXJS_FreePrivate(pObj->GetAlignedPointerFromInternalField(0)); pObj->SetAlignedPointerInInternalField(0, NULL); }
// static void CFXJS_Engine::FreeObjectPrivate(v8::Local<v8::Object> pObj) { if (pObj.IsEmpty() || !pObj->InternalFieldCount()) return; FreeObjectPrivate(pObj->GetAlignedPointerFromInternalField(0)); pObj->SetAlignedPointerInInternalField(0, nullptr); }