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 28477 - Warn against boolean arguments defaulting to true
Summary: Warn against boolean arguments defaulting to true
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-13 06:31 UTC by Anne
Modified: 2015-07-07 06:19 UTC (History)
4 users (show)

See Also:


Attachments

Description Anne 2015-04-13 06:31:35 UTC
Is there any API other than XMLHttpRequest where this happens?

Note that even XMLHttpRequest does not strictly do this since it needs to overload. So perhaps we could simply outlaw `= true` in general...
Comment 1 Boris Zbarsky 2015-04-13 12:52:31 UTC
I don't see any instances of optional boolean args defaulting true.

There seem to be a bunch of dictionary boolean options defaulting true, though...
Comment 2 Anne 2015-04-13 13:04:51 UTC
Stable features? That seems unfortunate. I guess it's less of a problem with dictionaries, but it still seems bad.
Comment 3 Jonas Sicking (Not reading bugmail) 2015-04-13 14:06:06 UTC
Yeah, dictionary arguments defaulting to true seems unfortunate/confusing too.
Comment 4 Jonas Sicking (Not reading bugmail) 2015-04-13 14:08:12 UTC
Yet here we are:
http://mxr.mozilla.org/mozilla-central/search?string=%3D+true&find=\.webidl%24&tree=mozilla-central
Comment 5 Boris Zbarsky 2015-04-13 14:42:02 UTC
> Stable features?

WebGL, Canvas2d, IDB, SVGGraphicsElement.getBBox, WebRTC.