Skip to content

Commit

Permalink
dir() fixup and comment vestigial code
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Jun 4, 2022
1 parent 0451626 commit 154d563
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/scripting/lua_kernel_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,10 @@ static void dir_meta_helper(lua_State* L, std::vector<std::string>& keys)
static int intf_object_dir(lua_State* L)
{
if(lua_isnil(L, 1)) return luaL_argerror(L, 1, "Can't dir() nil");
bool include_write_only = false;
if(lua_isboolean(L, 2)) {
include_write_only = luaW_toboolean(L, 2);
}
// bool include_write_only = false;
// if(lua_isboolean(L, 2)) {
// include_write_only = luaW_toboolean(L, 2);
// }
if(!lua_isfunction(L, -1)) {
luaW_getglobal(L, "print");
}
Expand All @@ -553,7 +553,7 @@ static int intf_object_dir(lua_State* L)
do {
int table_idx = lua_absindex(L, -1);
for(lua_pushnil(L); lua_next(L, table_idx); lua_pop(L, 1)) {
if(lua_isstring(L, -2)) {
if(lua_type(L, -2) == LUA_TSTRING) {
keys.push_back(lua_tostring(L,-2));
}
}
Expand Down

0 comments on commit 154d563

Please sign in to comment.