Skip to content
This repository has been archived by the owner on Mar 29, 2018. It is now read-only.

functions should be enumerable #13

Open
stefanpenner opened this issue Dec 28, 2014 · 7 comments
Open

functions should be enumerable #13

stefanpenner opened this issue Dec 28, 2014 · 7 comments

Comments

@stefanpenner
Copy link

No description provided.

@eventualbuddha
Copy link
Contributor

Does this mean that you believe this should log ['a']?

class A { a() {} }
console.log(Object.keys(new A()))

Neither 6to5 nor traceur behave this way. Do you have a place in the spec that makes this clear? Or perhaps @wycats can chime in?

@stefanpenner
Copy link
Author

apparently i was mistaken...

On chrome canary:

class A { a() {} }
Object.getOwnPropertyDescriptor(A.prototype, 'a').enumerable // => false

@jamiebuilds
Copy link

I spoke to @wycats on Twitter about this awhile back. They are supposed to be enumerable for backwards compatibility with how "classes" work in most javascript frameworks.

@sebmck
Copy link

sebmck commented Jan 1, 2015

Class methods are definently enumerable, no doubt about it. See babel/babel#138 and https://twitter.com/wycats/status/540893847388028929

@eventualbuddha
Copy link
Contributor

Yep, you're all right. I'll address this. Thanks!

@eventualbuddha eventualbuddha reopened this Jan 2, 2015
@stefanpenner
Copy link
Author

is chrome canary wrong then, or did i screw up in my example.

@jamiebuilds
Copy link

😜
screen shot 2015-01-01 at 5 03 38 pm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants