W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2009

Interactions between optional and nullable

From: Robin Berjon <robin@berjon.com>
Date: Tue, 8 Dec 2009 16:43:25 +0100
Message-Id: <2667AA0D-D664-4735-A070-35F6A503D365@berjon.com>
To: public-script-coord@w3.org
Hi,

I've been trying to figure out what the expected approach should be for the following case:

 interface Dahut {
     void foo (optional Foo foo, optional Bar bar);
 };

Assuming I want to call myDahut.foo() but skip the first parameter, the idiomatic ES would typically be:

 myDahut.foo(null, myBar);

But it turns out that the first parameter isn't defined as nullable. What happens here?

1) Is the implementation supposed to figure out that I didn't want to provide the first parameter? Maybe convert it to undefined?
2) Are people expected to call myDahut.foo(undefined, myBar) instead?
3) Should the operation be better defined with Foo being nullable?

Thanks!

-- 
Robin Berjon - http://berjon.com/
Received on Tuesday, 8 December 2009 15:44:10 UTC

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