W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

Re: Feedback requested on returning null/void or throwing an exception

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 1 Nov 2010 10:33:32 +1300
To: Nathan <nathan@webr3.org>
Cc: public-webapps <public-webapps@w3.org>
Message-ID: <20101031213331.GC27335@wok.mcc.id.au>
> We're debating this at the minute, one person has said yes "null"
> could be a converted value for them, which means yes it could be -
> however it's also been suggested that "null" is a single value thus,
> we could disallow it / reserve it, because a TypedLiteral with a
> type of "http://example.org/types/null" could only ever be null,
> thus detected and specified without needing any conversion
> functionality.

OK.  Anyway, whether you would want to return null or some other value
(or throw an exception) to indicate that no converted value was
available depends on the answer to the above question, I guess.

Note that undefined isn’t a native value of any IDL type, so specfiying
that that undefined is returned would be quite ECMAScript-specific.
Returning null in these cases is quite normal (assuming null isn’t a
value that could normally be returned, as above).

Cameron McCormack ≝ http://mcc.id.au/
Received on Sunday, 31 October 2010 21:34:09 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:28 UTC