> The ES6 class specification originally made prototype methods (we didn't > have static methods at the time) non-enumerable. > > That was changed at the Sept 19, 2012 TC39 meeting > https://mail.mozilla.org/pipermail/es-discuss/2012-September/025231.html
It may make sense if enumerability was repurposed as a runtime flag for privacy (in the sense of “you don’t need to know about this property/method”). That would nicely complement TypeScript’s static-only (= non-runtime) `private` keyword. It’s one of the two – largely orthogonal – use cases I see for privacy: 1. Completely protecting data from “external” access. In ES6, one can use WeakMaps and closures for this. 2. Encapsulation: Hide internal properties from sight, document internal-ness. If it’s advisory only then you can still write “friend” functions etc, without too much of a fuss. ### I’m looking for a simple explanation of what enumerability will be, going forward. If there isn’t one then I’d argue that no new feature should be influenced by it. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss