From c78b730c9082c5ddb0ae4b79915e81de2b96ec08 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 18 Feb 2016 14:57:04 +0100 Subject: [PATCH] loggingmanager,modulemanager,moduleapi: Localize unpack compatible with Lua 5.2+ --- core/moduleapi.lua | 3 ++- core/modulemanager.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/moduleapi.lua b/core/moduleapi.lua index 573f3153..9a0c5223 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -19,7 +19,8 @@ local st = require "util.stanza"; local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; local error, setmetatable, type = error, setmetatable, type; -local ipairs, pairs, select, unpack = ipairs, pairs, select, unpack; +local ipairs, pairs, select = ipairs, pairs, select; +local unpack = table.unpack or unpack; local tonumber, tostring = tonumber, tostring; local require = require; diff --git a/core/modulemanager.lua b/core/modulemanager.lua index 41c9b2fe..5d030513 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -23,7 +23,8 @@ local setmetatable, rawget = setmetatable, rawget; local ipairs, pairs, type, tostring, t_insert = ipairs, pairs, type, tostring, table.insert; local debug_traceback = debug.traceback; -local unpack, select = unpack, select; +local select = select; +local unpack = table.unpack or unpack; local pcall = function(f, ...) local n = select("#", ...); local params = {...}; -- 2.30.2