Skip to content
Snippets Groups Projects
Commit 2d2ff7e0 authored by Alexander Turenko's avatar Alexander Turenko Committed by Igor Munkin
Browse files

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
parent e3cf5a5d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment