| 959 | } |
| 960 | |
| 961 | void LuaEngine::contextLoad(int handleIndex, char const* contents, size_t size, char const* name) { |
| 962 | lua_checkstack(m_state, 2); |
| 963 | |
| 964 | // First load the script... |
| 965 | handleError(m_state, luaL_loadbuffer(m_state, contents, size, name)); |
| 966 | |
| 967 | // Then set the _ENV upvalue for the newly loaded chunk to our context env so |
| 968 | // we load the scripts into the right environment. |
| 969 | pushHandle(m_state, handleIndex); |
| 970 | lua_setupvalue(m_state, -2, 1); |
| 971 | |
| 972 | incrementRecursionLevel(); |
| 973 | int res = pcallWithTraceback(m_state, 0, 0); |
| 974 | decrementRecursionLevel(); |
| 975 | handleError(m_state, res); |
| 976 | } |
| 977 | |
| 978 | LuaDetail::LuaFunctionReturn LuaEngine::contextEval(int handleIndex, String const& lua) { |
| 979 | int stackSize = lua_gettop(m_state); |
no test coverage detected