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

undefined values in dictionaries

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 11 Jun 2013 16:43:04 -0400
Message-ID: <51B78BD8.4040906@mit.edu>
To: "public-script-coord@w3.org" <public-script-coord@w3.org>
Consider this IDL:

  dictionary Foo {
    DOMString member = "something";

and the following object being passed to an argument taking Foo:

   { member: undefined }

Per current WebIDL, this will be treated identically to { member: 
"undefined" }.  Is that what we want, or should it be treated 
identically to { } (which is treated like { member: "something" } in 
this case) instead?

Or put another way, for dictionaries the current "member is present" 
indicator is what "member in dictionary" returns, not what 
"dictionary.member != undefined" returns.  Both seem valid options 
depending on the API contract...

Received on Tuesday, 11 June 2013 20:43:34 UTC

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