this.name tut nicht. Es bleibt also dabei:
function foo() {
   console.log( foo.name );
   //document.getElementById("error").innerHTML='...' + foo.name;
}
foo();
Das "Den hast Du doch gerade erst eben ein paar Zeilen weiter oben notiert?" bleibt gültig...
Warum es das überhaupt gibt:
func=function foo() {
   console.log( foo.name );
   return 1;
}
console.log( func.name + ' returns ' + func() );
Ausgaben:
foo
foo returns 1