W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2013

Re: Possible compat problem with treating undefined as not passed in WebIDL

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 03 Oct 2013 17:03:02 -0400
Message-ID: <524DDB86.8010608@mit.edu>
To: Joshua Bell <jsbell@google.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>, Anne van Kesteren <annevk@annevk.nl>
On 10/3/13 2:25 PM, Joshua Bell wrote:
> Having an optional boolean argument default to "true" seems like poor JS
> API design for this reason.

Agreed.

> Hopefully there isn't much of it in the
> platform, and therefore overloads and/or prose is acceptable in legacy
> cases. Are you aware of other examples?

Not yet.  This was the only one that failed our automated tests in an 
obviously-undesirable way.  The other failures were all in passing 
undefined as the title to createHTMLDocument, which I expect is not 
likely to happen in the wild.  But as you say, this may have more to do 
with test coverage than anything else.

> The developer feedback on the APIs I've worked on is very strong that
> passing undefined is expected to behave the same behavior as not passed

I agree.  I think this is a good idea in general; we just need to adjust 
the XHR spec and keep an eye out for similar problems...

-Boris
Received on Thursday, 3 October 2013 21:03:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:18 UTC