| 1461 | } |
| 1462 | |
| 1463 | void CScriptObject::Delegate(IScriptObject *pObj) |
| 1464 | { |
| 1465 | if(!pObj)return; |
| 1466 | m_hDelegationTag = lua_newtag(m_pLS); |
| 1467 | lua_newuserdatabox(m_pLS, this); |
| 1468 | if(!lua_xgetref(m_pLS,pObj->GetRef()))return; |
| 1469 | lua_pushcclosure(m_pLS, CScriptObject::IndexTagHandler, 2); |
| 1470 | lua_settagmethod(m_pLS, m_hDelegationTag, "index"); |
| 1471 | if (!_GET_THIS()) |
| 1472 | { |
| 1473 | lua_pushnil(m_pLS); |
| 1474 | lua_settagmethod(m_pLS, m_hDelegationTag, "index"); |
| 1475 | return ; |
| 1476 | } |
| 1477 | |
| 1478 | lua_settag(m_pLS, m_hDelegationTag); |
| 1479 | lua_pop(m_pLS,1); |
| 1480 | } |
no test coverage detected