Re: Unclear behavior of dictionary member default values

On 6/8/12 3:17 AM, Anne van Kesteren wrote:
> 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'm not sure I follow...  You can have a dictionary like so:

dictionary Foo {
   long x = 5;
};

and then if I pass {} to a method taking a Foo, it will see x as set in 
the dictionary, with a value of 5.  Maybe.  The spec is not actually 
clear; hence my question.

If you want to allow a "no value" mode, you just leave off the default 
value, of course.

If the question was what specs use default values on dictionaries... 
WebGL does for the WebGLContextAttributes dictionary.

-Boris

Received on Friday, 8 June 2012 07:26:24 UTC