| 1456 | } |
| 1457 | |
| 1458 | void luaL_get_global_variables(lua_State *L, std::list<std::string> *list) |
| 1459 | { |
| 1460 | if (nullptr == list) |
| 1461 | return; |
| 1462 | lua_getglobal(L, "_G"); |
| 1463 | int it = lua_gettop(L); |
| 1464 | lua_pushnil(L); |
| 1465 | while (lua_next(L, it)) |
| 1466 | { |
| 1467 | list->push_back(std::string(lua_tostring(L, -2))); |
| 1468 | lua_pop(L, 1); |
| 1469 | } |
| 1470 | lua_pop(L, 1); |
| 1471 | } |
no test coverage detected