domenic at domenicdenicola.com (2014-01-17T23:53:19.873Z)
On Sat, Jan 11, 2014 at 12:24 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> 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:
```js
var o = {
method: function() {
}
};
```
To this:
```js
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.
On Sat, Jan 11, 2014 at 12:24 PM, Andrea Giammarchi < andrea.giammarchi at gmail.com> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140112/714c2058/attachment.html>