The code section that deals with functions that do not have a NAME attribute is buidling a string representation that later is not returned.
I edited the code to take care of this, and also thought that it would be nice to return a part of the function body for anonymous functions
MochiKit.Base.repr(o)
{
...
if (typeof(o) == "function") {
ostring = ostring.replace(/\s+/g, " ");
ostring = ostring.replace(/^\s+/, "");
if (ostring.match(/^function\s*\(/)) {
var limit = 60;
ostring = ostring.substr(0, limit) + (ostring.length>limit? "...":"");
} else {
var idx = ostring.indexOf("{");
if (idx != -1) {
ostring = ostring.substr(0, idx) + "{...}";
}
}
}