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

Function IsValidInstance

engine/script/src/script.cpp:999–1015  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

997 }
998
999 bool IsValidInstance(lua_State* L) {
1000 int top = lua_gettop(L);
1001 (void)top;
1002 GetInstance(L);
1003 if (GetMetaFunction(L, -1, META_TABLE_IS_VALID, sizeof(META_TABLE_IS_VALID) - 1)) {
1004 lua_pushvalue(L, -2);
1005 lua_call(L, 1, 1);
1006 assert(top + 2 == lua_gettop(L));
1007 bool result = lua_toboolean(L, -1);
1008 lua_pop(L, 2);
1009 assert(top == lua_gettop(L));
1010 return result;
1011 }
1012 lua_pop(L, 1);
1013 assert(top == lua_gettop(L));
1014 return false;
1015 }
1016
1017 void SetContextValue(HContext context)
1018 {

Callers 1

IsInstanceValidFunction · 0.85

Calls 7

lua_gettopFunction · 0.85
GetMetaFunctionFunction · 0.85
lua_pushvalueFunction · 0.85
lua_callFunction · 0.85
lua_tobooleanFunction · 0.85
GetInstanceFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected