# HG changeset patch # User Matthew Wild # Date 1335035047 -3600 # Node ID 2b3ee52fba32c64209cf30d75b47d2d02c128041 # Parent 645c93eaf249ed9d91ae740ef4df55722bc3f79b modulemanager: Make module_has_method and module_call_method use rawget() diff -r 645c93eaf249 -r 2b3ee52fba32 core/modulemanager.lua --- a/core/modulemanager.lua Sat Apr 21 20:02:45 2012 +0100 +++ b/core/modulemanager.lua Sat Apr 21 20:04:07 2012 +0100 @@ -261,12 +261,12 @@ 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";