Bug 15520 - alert(undefined) should say "undefined" in the alert
Summary: alert(undefined) should say "undefined" in the alert
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P3 Trivial
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-15 11:21 PDT by Darin Adler
Modified: 2007-10-17 10:14 PDT (History)
2 users (show)

See Also:


Attachments

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