W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

RE: [FileAPI] FileReader.readAsXXX when pased null

From: Adrian Bateman <adrianba@microsoft.com>
Date: Fri, 8 Jul 2011 15:10:02 +0000
To: "arun@mozilla.com" <arun@mozilla.com>, "Web Applications Working Group WG (public-webapps@w3.org)" <public-webapps@w3.org>, "Jonas Sicking (jonas@sicking.cc)" <jonas@sicking.cc>
Message-ID: <104E6B5B6535E849970CDFBB1C5216EB434FC6B0@TK5EX14MBXC136.redmond.corp.microsoft.com>
On Thursday, July 07, 2011 10:21 PM, Arun Ranganathan wrote:
> On 7/6/11 10:13 PM, Cameron McCormack wrote:
> > There was a recent change in Web IDL which made interface types (like
> > the readAsXXX argument types) not include null by default, and if you
> > want to allow null, to write it as “Type?”.  If you don’t change the
> > type in the File API spec to include the question mark, then Web IDL
> > defines it so that passing null means a TypeError will be thrown.
> >
> > If you want to do some additional processing beyond throwing an
> > exception (e.g. setting readyState), then you would need to allow null
> > by using “Blob?” as the type and then say what happens when null is
> > passed in.
> Wow, not only do I stand corrected, but I'm also gladdened :)  This
> change to WebIDL is a good one, and I'm sorry I missed it when it came
> out.
> Adrian: this should answer your original question, although I still
> think that in general, user agents differ pretty substantially over the
> type of exceptions that are being thrown (and this is yet another
> example).  Hopefully this is something we can fix with updates.

Yes, thanks. I think this is probably a good change although I'm worried that
there might be specs that allow null and don't realise they need to update to
Type?. Hopefully, if there are any, they'll be found when their dependency on
WebIDL is reviewed.

Received on Friday, 8 July 2011 15:10:39 UTC

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