MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / createmetatable

Function createmetatable

deps/lua/src/lstrlib.c:847–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845
846
847static void createmetatable (lua_State *L) {
848 lua_createtable(L, 0, 1); /* create metatable for strings */
849 lua_pushliteral(L, ""); /* dummy string */
850 lua_pushvalue(L, -2);
851 lua_setmetatable(L, -2); /* set string metatable */
852 lua_pop(L, 1); /* pop dummy string */
853 lua_pushvalue(L, -2); /* string library... */
854 lua_setfield(L, -2, "__index"); /* ...is the __index metamethod */
855 lua_pop(L, 1); /* pop metatable */
856}
857
858
859/*

Callers 1

luaopen_stringFunction · 0.85

Calls 4

lua_createtableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setmetatableFunction · 0.85
lua_setfieldFunction · 0.85

Tested by

no test coverage detected