I tested other browsers, and alert(undefined) should not say "", it should say "undefined".
This was fixed in <http://trac.webkit.org/projects/webkit/changeset/26616>. That patch also changed the behavior of "alert()" and "prompt('string')", as evident by the changes to test results. I think that change was wrong; in Firefox, prompt('foo') doesn't use "undefined" as the default value (and alert() throws a not enough arguments exception).
(In reply to comment #1) > This was fixed in <http://trac.webkit.org/projects/webkit/changeset/26616>. > > That patch also changed the behavior of "alert()" and "prompt('string')", as > evident by the changes to test results. I think that change was wrong; in > Firefox, prompt('foo') doesn't use "undefined" as the default value (and > alert() throws a not enough arguments exception). In the case of alert(), I think we're OK. IE shows an alert with the empty string and Firefox throws an exception. I think it's fine that we display the string "undefined". But prompt("string") I think is something else altogether! We don't want "undefined" as the default value in that case!
Bug 15541 filed on the prompt() issue.