mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
compat: Remove handling of Lua 5.1 location of 'unpack' function
This commit is contained in:
parent
d055a704d8
commit
5251c9b686
17 changed files with 17 additions and 17 deletions
|
@ -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;
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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_();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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") .. ")";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue