MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / copy_member_table

Function copy_member_table

ogsr_engine/Luabind/src/create_class.cpp:33–59  ·  view source on GitHub ↗

expects two tables on the lua stack: 1: destination 2: source

Source from the content-addressed store, hash-verified

31 // 1: destination
32 // 2: source
33 void copy_member_table(lua_State* L)
34 {
35 lua_pushnil(L);
36
37 while (lua_next(L, -2))
38 {
39 lua_pushstring(L, "__init");
40 if (lua_equal(L, -1, -3))
41 {
42 lua_pop(L, 2);
43 continue;
44 }
45 else lua_pop(L, 1); // __init string
46
47 lua_pushstring(L, "__finalize");
48 if (lua_equal(L, -1, -3))
49 {
50 lua_pop(L, 2);
51 continue;
52 }
53 else lua_pop(L, 1); // __finalize string
54
55 lua_pushvalue(L, -2); // copy key
56 lua_insert(L, -2);
57 lua_settable(L, -5);
58 }
59 }
60 }
61
62

Callers 1

stage2Method · 0.85

Calls 7

lua_equalFunction · 0.85
lua_pushnilFunction · 0.50
lua_nextFunction · 0.50
lua_pushstringFunction · 0.50
lua_pushvalueFunction · 0.50
lua_insertFunction · 0.50
lua_settableFunction · 0.50

Tested by

no test coverage detected