compat: Remove handling of Lua 5.1 location of 'unpack' function

This commit is contained in:
Kim Alvefur 2022-07-11 19:07:38 +02:00
parent d055a704d8
commit 5251c9b686
17 changed files with 17 additions and 17 deletions

View file

@ -27,7 +27,7 @@ local ipairs, pairs, select = ipairs, pairs, select;
local tonumber, tostring = tonumber, tostring;
local require = require;
local pack = table.pack or require "util.table".pack; -- table.pack is only in 5.2
local unpack = table.unpack or unpack; --luacheck: ignore 113 -- renamed in 5.2
local unpack = table.unpack;
local prosody = prosody;
local hosts = prosody.hosts;

View file

@ -1,6 +1,6 @@
local methods = {};
local resolver_mt = { __index = methods };
local unpack = table.unpack or unpack; -- luacheck: ignore 113
local unpack = table.unpack;
-- Find the next target to connect to, and
-- pass it to cb()

View file

@ -22,7 +22,7 @@ local _G = _G;
local prosody = _G.prosody;
local unpack = table.unpack or unpack; -- luacheck: ignore 113
local unpack = table.unpack;
local iterators = require "util.iterators";
local keys, values = iterators.keys, iterators.values;
local jid_bare, jid_split, jid_join = import("util.jid", "bare", "prepped_split", "join");

View file

@ -14,7 +14,7 @@ local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed
local pairs = pairs;
local next = next;
local type = type;
local unpack = table.unpack or unpack; -- luacheck: ignore 113
local unpack = table.unpack;
local calculate_hash = require "util.caps".calculate_hash;
local core_post_stanza = prosody.core_post_stanza;
local bare_sessions = prosody.bare_sessions;

View file

@ -1,4 +1,4 @@
local t_unpack = table.unpack or unpack; -- luacheck: ignore 113
local t_unpack = table.unpack;
local time_now = os.time;
local jid_prep = require "util.jid".prep;

View file

@ -13,7 +13,7 @@ local is_stanza = require"util.stanza".is_stanza;
local t_concat = table.concat;
local noop = function() end
local unpack = table.unpack or unpack; -- luacheck: ignore 113
local unpack = table.unpack;
local function iterator(result)
return function(result_)
local row = result_();

View file

@ -2,7 +2,7 @@
local ipairs, pairs = ipairs, pairs;
local setmetatable = setmetatable;
local tostring = tostring;
local next, unpack = next, table.unpack or unpack; --luacheck: ignore 113/unpack
local next, unpack = next, table.unpack;
local os_remove = os.remove;
local io_open = io.open;
local jid_bare = require "util.jid".bare;

View file

@ -580,7 +580,7 @@ function commands.reload(arg)
end
-- ejabberdctl compatibility
local unpack = table.unpack or unpack; -- luacheck: ignore 113
local unpack = table.unpack;
function commands.register(arg)
local user, host, password = unpack(arg);

View file

@ -1,4 +1,4 @@
local unpack = table.unpack or unpack; -- luacheck: ignore 113
local unpack = table.unpack;
local server = require "net.server_select";
package.loaded["net.server"] = server;

View file

@ -10,7 +10,7 @@
local t_pack = require "util.table".pack;
local serialize = require "util.serialization".serialize;
local unpack = table.unpack or unpack; --luacheck: ignore 113
local unpack = table.unpack;
local set = require "util.set";
local serialize_cfg = {

View file

@ -6,7 +6,7 @@
-- Provides some protection from e.g. CAPEC-135, CWE-117, CWE-134, CWE-93
local tostring = tostring;
local unpack = table.unpack or unpack; -- luacheck: ignore 113/unpack
local unpack = table.unpack;
local pack = require "util.table".pack; -- TODO table.pack in 5.2+
local valid_utf8 = require "util.encodings".utf8.valid;
local type = type;

View file

@ -4,7 +4,7 @@ local math_floor = math.floor;
local math_log = math.log;
local math_max = math.max;
local math_min = math.min;
local unpack = table.unpack or unpack; --luacheck: ignore 113
local unpack = table.unpack;
local large = {
"k", 1000,

View file

@ -8,7 +8,7 @@
local unpack = table.unpack or unpack; --luacheck: ignore 113
local unpack = table.unpack;
local t_insert = table.insert;
function _G.import(module, ...)
local m = package.loaded[module] or require(module);

View file

@ -12,7 +12,7 @@ local it = {};
local t_insert = table.insert;
local next = next;
local unpack = table.unpack or unpack; --luacheck: ignore 113
local unpack = table.unpack;
local pack = table.pack or require "util.table".pack;
local type = type;
local table, setmetatable = table, setmetatable;

View file

@ -9,7 +9,7 @@
local select = select;
local t_insert = table.insert;
local pairs, next, type = pairs, next, type;
local unpack = table.unpack or unpack; --luacheck: ignore 113
local unpack = table.unpack;
local _ENV = nil;
-- luacheck: std none

View file

@ -26,7 +26,7 @@ local log = require "util.logger".init("util.openmetrics");
local new_multitable = require "util.multitable".new;
local iter_multitable = require "util.multitable".iter;
local t_concat, t_insert = table.concat, table.insert;
local t_pack, t_unpack = require "util.table".pack, table.unpack or unpack; --luacheck: ignore 113/unpack
local t_pack, t_unpack = require "util.table".pack, table.unpack;
-- BEGIN of Utility: "metric proxy"
-- This allows to wrap a MetricFamily in a proxy which only provides the

View file

@ -2,7 +2,7 @@ local promise_methods = {};
local promise_mt = { __name = "promise", __index = promise_methods };
local xpcall = require "util.xpcall".xpcall;
local unpack = table.unpack or unpack; --luacheck: ignore 113
local unpack = table.unpack;
function promise_mt:__tostring()
return "promise (" .. (self._state or "invalid") .. ")";