From 800fd50ce0934689db0afaf6966ec6ba78f06eec Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 21 Apr 2012 20:04:07 +0100 Subject: modulemanager: Make module_has_method and module_call_method use rawget() --- core/modulemanager.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') 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"; -- cgit v1.2.3