MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / createFunctionFromSource

Method createFunctionFromSource

source/core/StarLua.cpp:1178–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1176}
1177
1178LuaFunction LuaEngine::createFunctionFromSource(int handleIndex, char const* contents, size_t size, char const* name) {
1179 lua_checkstack(m_state, 2);
1180
1181 handleError(m_state, luaL_loadbufferx(m_state, contents, size, name, "t"));
1182
1183 pushHandle(m_state, handleIndex);
1184 lua_setupvalue(m_state, -2, 1);
1185
1186 return LuaFunction(LuaDetail::LuaHandle(RefPtr<LuaEngine>(this), popHandle(m_state)));
1187}
1188
1189void LuaEngine::pushLuaValue(lua_State* state, LuaValue const& luaValue) {
1190 lua_checkstack(state, 1);

Callers

nothing calls this directly

Calls 5

lua_checkstackFunction · 0.85
luaL_loadbufferxFunction · 0.85
lua_setupvalueFunction · 0.85
LuaFunctionClass · 0.85
LuaHandleClass · 0.85

Tested by

no test coverage detected