diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-04-21 20:04:07 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-04-21 20:04:07 +0100 |
commit | 800fd50ce0934689db0afaf6966ec6ba78f06eec (patch) | |
tree | 940e82a5de36d48b5b3197ad33d371e431c32b83 /core | |
parent | 4664423a7b50fc7146c7e798af2d31e88ca5093e (diff) | |
download | prosody-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.lua | 6 |
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"; |