Mercurial > prosody-hg
comparison util/import.lua @ 7183:b606a5b32e91
util.import: Localize unpack() in Lua 5.2 compatible way
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 22 Feb 2016 17:37:55 +0100 |
| parents | bd0ff8ae98a8 |
| children | 5d866eb8f18f |
comparison
equal
deleted
inserted
replaced
| 7182:858ccafbd823 | 7183:b606a5b32e91 |
|---|---|
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| 11 local unpack = table.unpack or unpack; --luacheck: ignore 113 | |
| 11 local t_insert = table.insert; | 12 local t_insert = table.insert; |
| 12 function import(module, ...) | 13 function import(module, ...) |
| 13 local m = package.loaded[module] or require(module); | 14 local m = package.loaded[module] or require(module); |
| 14 if type(m) == "table" and ... then | 15 if type(m) == "table" and ... then |
| 15 local ret = {}; | 16 local ret = {}; |
