MCPcopy Create free account
hub / github.com/defold/defold / LuaLoadModule

Function LuaLoadModule

engine/script/src/script_module.cpp:66–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 }
65
66 static bool LuaLoadModule(lua_State *L, const char *buf, uint32_t size, const char *filename)
67 {
68 int top = lua_gettop(L);
69 (void) top;
70
71 int ret = luaL_loadbuffer(L, buf, size, filename);
72 if (ret == 0)
73 {
74 assert(top + 1 == lua_gettop(L));
75 return true;
76 }
77 else
78 {
79 dmLogError("Error running script: %s", lua_tostring(L,-1));
80 lua_pop(L, 1);
81 assert(top == lua_gettop(L));
82 return false;
83 }
84
85 return true;
86 }
87
88 static int LoadModule(lua_State *L) {
89 int top = lua_gettop(L);

Callers 2

LoadModuleFunction · 0.85
ReloadModuleFunction · 0.85

Calls 3

lua_gettopFunction · 0.85
luaL_loadbufferFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected