MCPcopy Create free account
hub / github.com/Tencent/UnLua / wrap

Function wrap

Plugins/UnLuaExtensions/LuaSocket/Source/src/except.cpp:37–43  ·  view source on GitHub ↗

-------------------------------------------------------------------------*\ * Try factory \*-------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

35* Try factory
36\*-------------------------------------------------------------------------*/
37static void wrap(lua_State *L) {
38 lua_createtable(L, 1, 0);
39 lua_pushvalue(L, -2);
40 lua_rawseti(L, -2, 1);
41 lua_pushvalue(L, lua_upvalueindex(1));
42 lua_setmetatable(L, -2);
43}
44
45static int finalize(lua_State *L) {
46 if (!lua_toboolean(L, 1)) {

Callers 1

finalizeFunction · 0.85

Calls 4

lua_createtableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_rawsetiFunction · 0.85
lua_setmetatableFunction · 0.85

Tested by

no test coverage detected