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

Function ResolveInInstance

engine/script/src/script.cpp:1412–1439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1410 }
1411
1412 void ResolveInInstance(lua_State* L, int ref)
1413 {
1414 DM_LUA_STACK_CHECK(L, 1);
1415
1416 GetInstanceContextTable(L);
1417 // [-1] instance context table or LUA_NIL
1418
1419 if (lua_type(L, -1) != LUA_TTABLE)
1420 {
1421 lua_pop(L, 1);
1422
1423 lua_pushnil(L);
1424 // [-1] LUA_NIL
1425 return;
1426 }
1427 // [-1] instance context table
1428
1429 lua_rawgeti(L, -1, ref);
1430 // [-2] instance context table
1431 // [-1] value
1432
1433 lua_insert(L, -2);
1434 // [-2] value
1435 // [-1] instance context table
1436
1437 lua_pop(L, 1);
1438 // [-1] value
1439 }
1440
1441
1442 struct LuaCallstackCtx

Callers 5

HandleUnrefMessageFunction · 0.85
HandleMessageFunction · 0.85
TEST_FFunction · 0.85
RunScriptFunction · 0.85
DispatchCallbackDDFFunction · 0.85

Calls 5

GetInstanceContextTableFunction · 0.85
lua_typeFunction · 0.85
lua_pushnilFunction · 0.85
lua_rawgetiFunction · 0.85
lua_insertFunction · 0.85

Tested by 2

TEST_FFunction · 0.68
DispatchCallbackDDFFunction · 0.68