W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] Don't throw for HTMLInputElement.files

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 9 Aug 2010 22:35:16 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1008092233370.13322@ps20323.dreamhostps.com>
On Tue, 15 Jun 2010, Jonas Sicking wrote:
> 
> Currently HTMLInputElement.files throws if accessed when type != "file". 
> I think it would be better to return null or an empty list. We generally 
> try to avoid throwing in general, and in particular things like 
> HTMLInputElement.checked doesn't throw even if the value doesn't apply. 
> So for consistency I don't think HTMLInputElement.files should throw 
> either.
> 
> Another reason not to throw is that people every so often enumerate all 
> the IDL attributes of element using |for each| constructs in javascript. 
> Such code tends to break if there are properties that throw upon access.

Changed.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 9 August 2010 15:35:16 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:59 UTC