Bug 15520
Summary: | alert(undefined) should say "undefined" in the alert | ||
---|---|---|---|
Product: | WebKit | Reporter: | Darin Adler <darin> |
Component: | WebCore JavaScript | Assignee: | 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
I tested other browsers, and alert(undefined) should not say "", it should say "undefined".
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
mitz
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
(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
Bug 15541 filed on the prompt() issue.