MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / push_environment_of

Function push_environment_of

extlibs/sol3/include/sol/sol.hpp:12899–12914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12897 } // namespace stack_detail
12898
12899 inline int push_environment_of(lua_State* L, int index = -1) {
12900#if defined(SOL_SAFE_STACK_CHECK) && SOL_SAFE_STACK_CHECK
12901 luaL_checkstack(L, 1, detail::not_enough_stack_space_environment);
12902#endif // make sure stack doesn't overflow
12903#if SOL_LUA_VERSION < 502
12904 // Use lua_getfenv
12905 lua_getfenv(L, index);
12906#else
12907 // Use upvalues as explained in Lua 5.2 and beyond's manual
12908 if (lua_getupvalue(L, index, 1) == nullptr) {
12909 push(L, lua_nil);
12910 return 1;
12911 }
12912#endif
12913 return 1;
12914 }
12915
12916 template <typename T>
12917 int push_environment_of(const T& target) {

Callers 2

basic_environmentMethod · 0.85
get_environmentFunction · 0.85

Calls 5

lua_getupvalueFunction · 0.85
pushFunction · 0.85
luaL_checkstackFunction · 0.70
pushMethod · 0.45
lua_stateMethod · 0.45

Tested by

no test coverage detected