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
commit3f130834834b04f47b0c00bb5504e67e0744fa16 (patch)
tree940e82a5de36d48b5b3197ad33d371e431c32b83 /core
parentbf4925029fade8287314c858029413aacc5a9a48 (diff)
downloadprosody-3f130834834b04f47b0c00bb5504e67e0744fa16.tar.gz
prosody-3f130834834b04f47b0c00bb5504e67e0744fa16.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";