classes and enumerability

Caitlin Potter caitpotter88 at gmail.com
Wed Dec 24 16:17:00 PST 2014


Supposing that methods were non-enumerable by default, would accessors be different, or also non-enumerable by default?

In most cases, accessors would make sense to be enumerable, e.g. for JSON serialization, but that would be sort of inconsistent and confusing if the default were different from methods

(Just thinking out loud)

> On Dec 24, 2014, at 7:09 PM, Brendan Eich <brendan at mozilla.org> wrote:
> 
> Brendan Eich wrote:
>> There's a confounding variable: the pain of ES6s meta-object APIs, in all respects.
> 
> I meant "ES5's" here, of course.
> 
> Agree with Jeremy, laziness is a programmer virtue and a part of human nature. People are not bothering where they don't know better, or do perhaps know enough but don't have time and cause to take the trouble. The trouble is due to the non-default nature of non-enumerability. Arguing from that past default to (still-future for a little while!) ES6 class's prototype methods being non-enumerable is circular, if you ignore the foolish-consistency argument (which I think we should, but I"m not dismissing here -- just noting that it isn't enough to avoid circularity because of the ES5's-painful-to-use confounder).
> 
> /be
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list