Bug 15520

Summary: alert(undefined) should say "undefined" in the alert
Product: WebKit Reporter: Darin Adler <darin>
Component: WebCore JavaScriptAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Trivial CC: mitz, sam
Priority: P3    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   

Darin Adler
Reported 2007-10-15 11:21:04 PDT
I tested other browsers, and alert(undefined) should not say "", it should say "undefined".
Attachments
mitz
Comment 1 2007-10-16 23:50:12 PDT
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).
Darin Adler
Comment 2 2007-10-17 07:51:12 PDT
(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!
mitz
Comment 3 2007-10-17 10:14:59 PDT
Bug 15541 filed on the prompt() issue.
Note You need to log in before you can comment on or make changes to this bug.