Re: IndexedDB: undefined parameters

On Wed, Oct 10, 2012 at 3:58 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Wed, Oct 10, 2012 at 11:15 AM, Odin Hørthe Omdal <odinho@opera.com>
> wrote:
> > Last time I looked at it, WebIDL said [TreatUndefinedAs=Missing] is
> meant to
> > be for legacy API's, and not new ones. I think that a bit strange and
> > counter productive. Why?
>
> [TreatUndefinedAs] is only intended for arguments that take DOMString
> or DOMString?.
>
> http://dev.w3.org/2006/webapi/WebIDL/#TreatUndefinedAs


I think we're confused by the following text at the above link (a couple
paragraphs down), which contrasts with the first use case (DOMString):

The second use for [TreatUndefinedAs] is to control how undefined values
> passed to a function corresponding to an operation are treated. If it is
> specified as[TreatUndefinedAs=Missing] on an optional operation argument,
> then an explicit undefined value will cause the function call to be treated
> as if the argument had been omitted.


If this behavior should indeed be the default to match ES6 semantics (which
I think practically everyone on this thread agrees is a Good Thing), then
the above paragraph is redundant and the overload resolution algorithm step
4 can be simplified.

Received on Wednesday, 10 October 2012 23:12:18 UTC