This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html Multipage: http://www.whatwg.org/C#2dcontext Complete: http://www.whatwg.org/c#2dcontext Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/ Comment: CanvasFillRule arguments should be [TreatUndefinedAs=Missing] Posted from: 98.110.194.206 by bzbarsky@mit.edu User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20130521 Firefox/24.0
See https://bugzilla.mozilla.org/show_bug.cgi?id=861938
(In reply to comment #1) > See https://bugzilla.mozilla.org/show_bug.cgi?id=861938 If WebIDL could specify this as the default behavior (which seems to be what people want), we won't have to change the spec.
heycam, is this something that you're planning on doing to WebIDL?
Yeah, I'm going to change how undefined works soon (next week probably), to match how ES6 handles it, which is that undefined for an optional argument is like not specifying it at all.
(In reply to comment #4) > Yeah, I'm going to change how undefined works soon (next week probably), to > match how ES6 handles it, which is that undefined for an optional argument > is like not specifying it at all. What if you pass a different argument type (i.e. an object). Will your change automatically promote it to undefined and missing?
No, and that doesn't happen with [TreatUndefinedAs=Missing]. If you do that with these APIs, they will throw (unless your object's toString produces an element of this enum). Which seems fine to me, frankly.
(In reply to comment #6) > No, and that doesn't happen with [TreatUndefinedAs=Missing]. If you do that > with these APIs, they will throw (unless your object's toString produces an > element of this enum). Which seems fine to me, frankly. ah, I was under the impression that we were trying to allow any argument. Rereading the linked bug, this is just about [undefined]. With Cameron's change, the spec doesn't have to be updated so this bug can be closed.
Closing per comment 7; if you disagree please don't hesitate to reopen it. heycam, if there are implications of your change on what I say anywhere in the HTML spec that you know of, please file a bug on me to fix it (or drop me a mail, whichever), thanks!
The Web IDL changes have been made now, so undefined will be treated as a missing optional argument (and fill in the default value) automatically.