| 1802 | } |
| 1803 | |
| 1804 | void LuaEngine::executeReturn(LuaHandler*& luaHandler, int handler, int paramCount) { |
| 1805 | int top = lua_gettop(L) - paramCount; |
| 1806 | DEFER(lua_settop(L, top)); |
| 1807 | if (LuaEngine::invoke(L, handler, paramCount, 1)) { |
| 1808 | int funcRef = tolua_ref_function(L, -1); |
| 1809 | if (funcRef > 0) { |
| 1810 | luaHandler = LuaHandler::create(funcRef); |
| 1811 | } else { |
| 1812 | Error("Lua callback should return another function."); |
| 1813 | } |
| 1814 | } |
| 1815 | } |
| 1816 | |
| 1817 | bool LuaEngine::isInLua() { |
| 1818 | return _callFromLua > 0; |
no test coverage detected