W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: Unclear behavior of dictionary member default values

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 08 Jun 2012 03:25:50 -0400
Message-ID: <4FD1A8FE.5020700@mit.edu>
To: Anne van Kesteren <annevk@annevk.nl>
CC: public-script-coord@w3.org
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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC