| 570 | |
| 571 | |
| 572 | static int ll_seeall (lua_State *L) { |
| 573 | luaL_checktype(L, 1, LUA_TTABLE); |
| 574 | if (!lua_getmetatable(L, 1)) { |
| 575 | lua_createtable(L, 0, 1); /* create new metatable */ |
| 576 | lua_pushvalue(L, -1); |
| 577 | lua_setmetatable(L, 1); |
| 578 | } |
| 579 | lua_pushvalue(L, LUA_GLOBALSINDEX); |
| 580 | lua_setfield(L, -2, "__index"); /* mt.__index = _G */ |
| 581 | return 0; |
| 582 | } |
| 583 | |
| 584 | |
| 585 | /* }====================================================== */ |
nothing calls this directly
no test coverage detected