WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
15520
alert(undefined) should say "undefined" in the alert
https://bugs.webkit.org/show_bug.cgi?id=15520
Summary
alert(undefined) should say "undefined" in the alert
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
Add attachment
proposed patch, testcase, etc.
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.
Top of Page
Format For Printing
XML
Clone This Bug