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

Re: Feature-detectable API extensions?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 28 Aug 2013 01:03:24 -0400
Message-ID: <521D849C.4050306@mit.edu>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
CC: Joshua Bell <jsbell@google.com>, public-script-coord <public-script-coord@w3.org>
On 8/28/13 12:24 AM, Allen Wirfs-Brock wrote:
> I think that the appropriate translation of WebIDL to ES6 is that WebIDL "optional" always turns into an ES6 parameter with a default value initializer.

Why is that?  I'd like to understand the reasoning...

> If the WebIDL source includes an explicit default value then that value should be used as the ES6 default value.  If the WebIDL does not have an explicit default value then the implicit WebIDL default should be used as the ES6 default value.

There is no implicit WebIDL default value.  If there is no default 
value, then the argumen is "not passed" just like it would be undefined 
in a JS function.

> If you do this, then the WebIDL length based upon "optional" should match the ES8 length based upon default value initializers.

I agree, but should that be the goal?  Or would a better definition of 
"length" make sense for WebIDL (e.g. counting optional args without 
default values in the length)?

-Boris
Received on Wednesday, 28 August 2013 05:03:53 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:50 UTC