prosody

changeset 3024
9c74785c6351
parent 3023
454e1cf18daf
child 3029
0c7beabfed5b
child 3304
fec74b84df61
--- 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
 

mercurial