projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be7f7b3
)
prosody: Modified function metatable for better string representation of functions.
author
Waqas Hussain
<waqas20@gmail.com>
Fri, 7 May 2010 11:02:29 +0000
(16:02 +0500)
committer
Waqas Hussain
<waqas20@gmail.com>
Fri, 7 May 2010 11:02:29 +0000
(16:02 +0500)
prosody
patch
|
blob
|
history
diff --git
a/prosody
b/prosody
index 0232b83b704a81ef90992c0e551835135d985de4..e4e821050d60829c9b8c652d33e003ec7bde470c 100755
(executable)
--- a/
prosody
+++ b/
prosody
@@
-143,6
+143,10
@@
function set_function_metatable()
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