Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions include/ponder/uses/lua.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ void expose(lua_State *L, const Class& cls, const IdRef name)
lua_pushglobaltable(L); // +1
lua_pushliteral(L, PONDER__LUA_METATBLS); // +1
lua_rawget(L, -2); // 0 -+
if (lua_isnil(L, -1))
bool isnil = lua_isnil(L, -1);
if (isnil)
{
// first time
lua_pop(L, 1); // -1 pop nil
Expand Down Expand Up @@ -459,7 +460,7 @@ void expose(lua_State *L, const Class& cls, const IdRef name)
lua_setmetatable(L, -2); // -1

lua_rawset(L, -3); // -2 _G[CLASSNAME] = class_obj
lua_pop(L, 2); // -2 global,meta
lua_pop(L, isnil ? 2 : 3); // -2 global,meta
}

void expose(lua_State *L, const Enum& enm, const IdRef name)
Expand Down