lua: eliminate luaL_register*() usages
See the previous commit regarding the idea behind this refactoring. The src/box/lua part is updated in a next commit, only `src/lua` is updated here. It is split to ease reading. The patch is mostly straightforward, I'll highlight several interesting places. * `compat` `_G.internal.compat` was created by `luaL_register()`. Removing of this call drops `_G.internal`: it is not created anymore. * `fiber.channel` and `fiber.cond` The initialization code add fields into fiber module. So we call `require('fiber')` here. The alternative is to access `package.loaded.fiber` directly, however I plan to eliminate such accesses in further patches. (Built-in modules registration process will use its own table instead of `package.loaded`.) * `http.client` Here we also eliminate a direct access to `package.loaded`, which is important for implementing #7774. Dropping of the `package.loaded['http.client']` field in unnecessary, because it is anyway replaced by the resulting module table in `tarantool_lua_init()`. * `utf8` This module is also set to `_G.utf8` for compatibility with Lua 5.3. It remains unchanged. Part of #7774 NO_DOC=user visible behavior is unchanged, pure refactoring change NO_TEST=see NO_DOC NO_CHANGELOG=see NO_DOC
Showing
- src/lua/compat.c 1 addition, 1 deletionsrc/lua/compat.c
- src/lua/decimal.c 1 addition, 1 deletionsrc/lua/decimal.c
- src/lua/digest.c 1 addition, 1 deletionsrc/lua/digest.c
- src/lua/errno.c 1 addition, 1 deletionsrc/lua/errno.c
- src/lua/fiber.c 1 addition, 1 deletionsrc/lua/fiber.c
- src/lua/fiber_channel.c 8 additions, 1 deletionsrc/lua/fiber_channel.c
- src/lua/fiber_cond.c 8 additions, 1 deletionsrc/lua/fiber_cond.c
- src/lua/fio.c 3 additions, 3 deletionssrc/lua/fio.c
- src/lua/httpc.c 1 addition, 1 deletionsrc/lua/httpc.c
- src/lua/httpc.lua 1 addition, 2 deletionssrc/lua/httpc.lua
- src/lua/init.c 9 additions, 4 deletionssrc/lua/init.c
- src/lua/pickle.c 1 addition, 1 deletionsrc/lua/pickle.c
- src/lua/popen.c 1 addition, 1 deletionsrc/lua/popen.c
- src/lua/socket.c 1 addition, 1 deletionsrc/lua/socket.c
- src/lua/swim.c 1 addition, 1 deletionsrc/lua/swim.c
- src/lua/uri.c 2 additions, 2 deletionssrc/lua/uri.c
- src/lua/utf8.c 3 additions, 2 deletionssrc/lua/utf8.c
- test/app-luatest/http_client_unit_test.lua 3 additions, 5 deletionstest/app-luatest/http_client_unit_test.lua
Loading
Please register or sign in to comment