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

Interactions between optional and nullable

From: Robin Berjon <robin@robineko.com>
Date: Tue, 8 Dec 2009 16:38:44 +0100
Message-Id: <83A93723-B019-419D-92F2-559C8B04AEC1@robineko.com>
To: public-script-coord@w3.org

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?


Robin Berjon
  robineko  hired gun, higher standards
Received on Tuesday, 8 December 2009 15:47:17 UTC

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