aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-21 20:04:07 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-21 20:04:07 +0100
commit800fd50ce0934689db0afaf6966ec6ba78f06eec (patch)
tree940e82a5de36d48b5b3197ad33d371e431c32b83 /core
parent4664423a7b50fc7146c7e798af2d31e88ca5093e (diff)
downloadprosody-800fd50ce0934689db0afaf6966ec6ba78f06eec.tar.gz
prosody-800fd50ce0934689db0afaf6966ec6ba78f06eec.zip
modulemanager: Make module_has_method and module_call_method use rawget()
Diffstat (limited to 'core')
-rw-r--r--core/modulemanager.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index f7594cd9..769041f9 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -261,12 +261,12 @@ function is_loaded(host, name)
end
function module_has_method(module, method)
- return type(module.module[method]) == "function";
+ return type(rawget(module.module, method)) == "function";
end
function call_module_method(module, method, ...)
- if module_has_method(module, method) then
- local f = module.module[method];
+ local f = rawget(module.module, method);
+ if type(f) == "function" then
return pcall(f, ...);
else
return false, "no-such-method";