Re: Unclear behavior of dictionary member default values

On Fri, Jun 8, 2012 at 8:46 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> It's not quite clear to me what the right behavior of dictionary member
> default values is.  Specifically:
>
> 1)  For a dictionary argument, does the implementation actually need to keep
> track of whether a member with a default value was present or not?  Or can
> it simply set the member to that default value and treat it as present?
>
> 2)  For dictionary return values, what, if anything, should happen with
> default values?  Should they end up on the JS object if the relevant member
> was not present in the dictionary?

I think the default value concept is actually problematic as the
dictionary argument is typically optional. When that is the case you
still need to handle the case for when it is omitted and define the
default values in prose. (I'd be interested in seeing examples of
specifications where this is not the case.)


-- 
Anne — Opera Software
http://annevankesteren.nl/
http://www.opera.com/

Received on Friday, 8 June 2012 07:18:09 UTC