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

Function RegisterUserTypeLocal

engine/script/src/script.cpp:767–780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765
766
767 uint32_t RegisterUserTypeLocal(lua_State* L, const char* name, const luaL_reg meta[])
768 {
769 DM_LUA_STACK_CHECK(L, 0);
770
771 luaL_newmetatable(L, name);
772 uint32_t type_hash = SetUserType(L, -1, name);
773
774 luaL_register (L, 0, meta);
775 lua_pushvalue(L, -1);
776 lua_setfield(L, -1, "__index");
777 lua_pop(L, 1);
778
779 return type_hash;
780 }
781
782
783 uint32_t RegisterUserType(lua_State* L, const char* name, const luaL_reg methods[], const luaL_reg meta[]) {

Callers

nothing calls this directly

Calls 4

luaL_newmetatableFunction · 0.85
SetUserTypeFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfieldFunction · 0.85

Tested by

no test coverage detected