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

Function PushValueAsString

engine/script/src/script.cpp:460–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458 }
459
460 static const char* PushValueAsString(lua_State* L, int index)
461 {
462 lua_pushvalue(L, index);
463 // [-1] value
464 lua_getglobal(L, "tostring");
465 // [-2] value
466 // [-1] tostring()
467 lua_insert(L, -2);
468 // [-2] tostring()
469 // [-1] value
470 lua_call(L, 1, 1);
471 // [-1] result
472 const char* result = lua_tostring(L, -1);
473 if (result == 0x0)
474 {
475 lua_pop(L, 1);
476 }
477 return result;
478 }
479
480 static int DoLuaPPrintTable(lua_State* L, int index, dmPPrint::Printer* printer, dmHashTable<uintptr_t, bool>& printed_tables) {
481 DM_LUA_STACK_CHECK(L, 0);

Callers 2

DoLuaPPrintTableFunction · 0.85
LuaPPrintFunction · 0.85

Calls 3

lua_pushvalueFunction · 0.85
lua_insertFunction · 0.85
lua_callFunction · 0.85

Tested by

no test coverage detected