classes and enumerability

Yehuda Katz wycats at gmail.com
Thu Jan 29 18:41:17 PST 2015


On Thu, Jan 29, 2015 at 5:51 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 1/29/15 5:43 PM, Allen Wirfs-Brock wrote:
>
>> My sense, from the informal discussions about this at the TC39 meeting,
>> is that most of us would hope that new WebIDL abstractions follow the ES6
>> class conventions and that existing WebIDL, because of legacy constrants
>> abstraction are likely not to migrate to the ES6 class conventions.
>>
>
> OK.  Just so we're clear, there are well north of 500 existing Web IDL
> interfaces defined in the web platform.  It will be a while, if ever,
> before the "new" ones get anywhere close to that.
>

I've personally written a lot of code that enumerates over the properties
of an element or other DOM object for some reason or other. I strongly
suspect that making existing WebIDL attributes non-enumerable would not be
web-compatible (nor, or even in the somewhat distant future).


> So what that approach (assuming none of the existing things are migrated)
> does is basically doom the web platform to always having behavior that
> authors can't predict.  I doubt I can actually get on board with that
> course of action....  :(


I agree that that sounds bad. The options seem to be:

   1. DOM objects don't behave like classes defined with inline methods
   2. Only new DOM objects behave like classes defined with inline methods
   3. Change all DOM objects to behave that way, if we can do so without
   breaking the web

I would agree that (2) isn't a good option, and I doubt (3) is
web-compatible ... :tears:


>
>
>  Syntactically, in WebIDL, you would presumably need an attribute or
>> something to indicate which set of conventions to use for any particular
>> interface.
>>
>
> Sure.  I'm worried about the goals, not the syntax; the syntax is trivial.
>
> -Boris
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150129/6f8e4bf3/attachment-0001.html>


More information about the es-discuss mailing list