Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with generator method with a symbol name #119

Closed
julien-f opened this issue Apr 20, 2015 · 4 comments

Comments

@julien-f
Copy link

commented Apr 20, 2015

standard prints indx.js:0:0: Cannot read property 'toString' of undefined with the following code:

console.log(class {
  * [Symbol.iterator] () {}
})

There are no errors if is an object literal instead of a class:

console.log({
  * [Symbol.iterator] () {}
})

And if the computed property name is not a symbol but a plain string I get the incorrect but different error message 2:12: Expected spaces around *.:

console.log(class {
  * ['foo'] () {}
})
@julien-f

This comment has been minimized.

Copy link
Author

commented Apr 20, 2015

The first issue is already reported to ESpree (eslint/espree#123) but not the second one.

@feross

This comment has been minimized.

Copy link
Member

commented Apr 20, 2015

Can you also report the second issue to eslint/espree? That's the right place for it. It's a dependency of a dependecy for standard ;-).

@feross feross closed this Apr 20, 2015

@julien-f

This comment has been minimized.

Copy link
Author

commented Apr 21, 2015

After investigation it seems it simply does not work with methods in classes.

Anyways, the generator-star is deprecated in favor of generator-star-spacing (which also has an issue with generator methods but is more likely to get fixed − eslint/eslint#2351).

@feross

This comment has been minimized.

Copy link
Member

commented Apr 23, 2015

I delete deprecated rules from the .eslintrc whenever we bump the eslint version.

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.