classes and enumerability

Kevin Smith zenparsing at
Wed Dec 24 10:02:31 PST 2014

> ```js
> class List extends Array {
>    itsGoingToBeEnumerable() {
>      return 'but does it have to and would you expect to?';
>    }
> }
> ```

That's a good point.

As far as I can tell, the downside risk associated with making class
methods non-enumerable centers around mixins:

- Legacy mixin utilities will tend to fail when given ES6 classes.
- We have no built-in function for doing proper mixins yet, and
`Object.assign` won't work at all.

I looked through my ES6 code and found a place where I was using
`Object.assign` as an simplistic mixin function.  It might be a pain to
have to import a userland utility for such cases.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list