# HG changeset patch # User Waqas Hussain # Date 1273230149 -18000 # Node ID 9c74785c6351e87f528bc7a39ab0a3b58d024c34 # Parent 454e1cf18daf3d6968375eb7ec8a2ca8e36bdfa5 prosody: Modified function metatable for better string representation of functions. diff -r 454e1cf18daf -r 9c74785c6351 prosody --- a/prosody Fri May 07 16:00:33 2010 +0500 +++ b/prosody Fri May 07 16:02:29 2010 +0500 @@ -143,6 +143,10 @@ debug.setupvalue(f, i, value); end end + function mt.__tostring(f) + local info = debug.getinfo(f); + return ("function(%s:%d)"):format(info.short_src:match("[^\\/]*$"), info.linedefined); + end debug.setmetatable(function() end, mt); end