This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21587 - Consider making the arguments to alert, confirm, prompt optional
Summary: Consider making the arguments to alert, confirm, prompt optional
Status: CLOSED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-05 09:56 UTC by Ms2ger
Modified: 2013-04-14 07:59 UTC (History)
3 users (show)

See Also:


Attachments

Description Ms2ger 2013-04-05 09:56:25 UTC
Looking at <http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2202>, IE and Chrome allow calling all these without arguments; and Gecko allows calling prompt without arguments, while it throws for alert and confirm.
Comment 1 Ian 'Hixie' Hickson 2013-04-11 22:31:01 UTC
What's the point of calling these with no arguments? Is there a compat need here?

I don't much care, but it does seem a bit wacked.
Comment 2 Simon Pieters 2013-04-11 23:18:49 UTC
Presto also allows no argument (alerts ""). WebKit alerts "undefined" when omitting the argument.

Looking at http://webdevdata.org/ data-dec2012, I see 10 instances of commented-out alert(); which I guess comes from alert-debugging. I didn't see any instances that were not commented-out.
Comment 3 Ian 'Hixie' Hickson 2013-04-14 07:23:32 UTC
Debugging alerts aren't a big deal since you're typically targeting a particular browser when debugging.

But I guess if so many browsers do it...

I've defaulted it to "". "undefined" seem unnecessarily ugly.