aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-05-06 19:26:53 +0100
committerMatthew Wild <mwild1@gmail.com>2015-05-06 19:26:53 +0100
commitdaec51c435ca77914271200607841d55ff7408d7 (patch)
tree15f1682fbc9c2ea904651bcc59e99d2397b0d4a8 /core/modulemanager.lua
parentba96c2f7db5ce079d7609dff90591b9872ba6143 (diff)
parenta540d613cd08b8feee096d19b727d1f5b2cab507 (diff)
downloadprosody-daec51c435ca77914271200607841d55ff7408d7.tar.gz
prosody-daec51c435ca77914271200607841d55ff7408d7.zip
Merge 0.10->trunk
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 92372ac3..e629b005 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -17,13 +17,13 @@ local new_multitable = require "util.multitable".new;
local hosts = hosts;
local prosody = prosody;
-local pcall, xpcall = pcall, xpcall;
+local xpcall = xpcall;
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;
-pcall = function(f, ...)
+local pcall = function(f, ...)
local n = select("#", ...);
local params = {...};
return xpcall(function() return f(unpack(params, 1, n)) end, function(e) return tostring(e).."\n"..debug_traceback(); end);
@@ -131,7 +131,7 @@ local function do_load_module(host, module_name, state)
local _log = logger.init(host..":"..module_name);
local host_module_api = setmetatable({
host = host, event_handlers = new_multitable(), items = {};
- _log = _log, log = function (self, ...) return _log(...); end;
+ _log = _log, log = function (self, ...) return _log(...); end; --luacheck: ignore 212/self
},{
__index = modulemap["*"][module_name].module;
});
@@ -152,8 +152,9 @@ local function do_load_module(host, module_name, state)
local _log = logger.init(host..":"..module_name);
local api_instance = setmetatable({ name = module_name, host = host,
- _log = _log, log = function (self, ...) return _log(...); end, event_handlers = new_multitable(),
- reloading = not not state, saved_state = state~=true and state or nil }
+ _log = _log, log = function (self, ...) return _log(...); end, --luacheck: ignore 212/self
+ event_handlers = new_multitable(), reloading = not not state,
+ saved_state = state~=true and state or nil }
, { __index = api });
local pluginenv = setmetatable({ module = api_instance }, { __index = _G });