On Sat, Jan 11, 2014 at 12:24 PM, Andrea Giammarchi <
[email protected]> wrote:
> I would like to see some Rick or David example about the "expected to be
> enumerable".
>
> If that's about knowing if a class is native or not, looping with a for/in
> its prototype or any instance does not seem to mean anything reliable since
> even native methods can be redefined and made enumerable.
>
Making concise method definitions default to enumerable: true had _nothing_
to do with classes and everything to do with code that *consumes* objects
with concise method definitions. Refactoring this:
var o = {
method: function() {
}
};
To this:
var o = {
method() {
}
};
Should absolutely not change the resulting behaviour of a for-in loop over
o's properties. I don't know why Allen said that for-in has been deprecated
in favor of for-of, since the latter doesn't imply iteration over the
properties of a plain object. That's not going away.
Rick
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss