/////////////////////////////////////////////////////////////////////
| 692 | |
| 693 | ////////////////////////////////////////////////////////////////////////// |
| 694 | void CScriptTable::Clear() |
| 695 | { |
| 696 | CHECK_STACK(L); |
| 697 | |
| 698 | PushRef(); |
| 699 | int trgTable = lua_gettop(L); |
| 700 | |
| 701 | lua_pushnil(L); // first key |
| 702 | while (lua_next(L, trgTable) != 0) |
| 703 | { |
| 704 | lua_pop(L, 1); // pop value, leave index. |
| 705 | lua_pushvalue(L, -1); // Push again index. |
| 706 | lua_pushnil(L); |
| 707 | lua_rawset(L, trgTable); |
| 708 | } |
| 709 | assert(lua_istable(L, -1)); |
| 710 | lua_pop(L, 1); |
| 711 | } |
| 712 | |
| 713 | ////////////////////////////////////////////////////////////////////////// |
| 714 | void CScriptTable::SetMetatable(IScriptTable* pMetatable) |
no outgoing calls
no test coverage detected