CFXJSE_HostObject* CFXJSE_Arguments::GetObject(int32_t index, CFXJSE_Class* pClass) const { v8::Local<v8::Value> hValue = (*m_pInfo)[index]; ASSERT(!hValue.IsEmpty()); if (!hValue->IsObject()) return nullptr; return FXJSE_RetrieveObjectBinding(hValue.As<v8::Object>(), pClass); }
void* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const { ASSERT(!m_hValue.IsEmpty()); CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue); ASSERT(!hValue.IsEmpty()); if (!hValue->IsObject()) { return NULL; } return FXJSE_RetrieveObjectBinding(hValue.As<v8::Object>(), lpClass); }
CFXJSE_HostObject* CFXJSE_Value::ToHostObject(CFXJSE_Class* lpClass) const { ASSERT(!m_hValue.IsEmpty()); CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local<v8::Value> pValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue); ASSERT(!pValue.IsEmpty()); if (!pValue->IsObject()) return nullptr; return FXJSE_RetrieveObjectBinding(pValue.As<v8::Object>(), lpClass); }