More work on console I/O and minor fixes
This commit is contained in:
@@ -315,7 +315,7 @@ void LuaStack::makesubtable(LuaSlot sub, LuaSlot tab, const char *name) const {
|
||||
}
|
||||
}
|
||||
|
||||
void LuaStack::cleartable(LuaSlot tab) const {
|
||||
void LuaStack::cleartable(LuaSlot tab, bool clearmeta) const {
|
||||
checktable(tab);
|
||||
lua_pushnil(L_);
|
||||
while (lua_next(L_, tab.index()) != 0) {
|
||||
@@ -324,6 +324,10 @@ void LuaStack::cleartable(LuaSlot tab) const {
|
||||
lua_pushnil(L_); // Push the new value.
|
||||
lua_rawset(L_, tab.index());
|
||||
}
|
||||
if (clearmeta) {
|
||||
lua_pushnil(L_);
|
||||
lua_setmetatable(L_, tab.index());
|
||||
}
|
||||
}
|
||||
|
||||
int LuaStack::rawlen(LuaSlot obj) const {
|
||||
|
||||
Reference in New Issue
Block a user