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

Class bodies shouldn't reference arguments in 1.11.0 #4320

Closed
monstersintokyo opened this issue Sep 26, 2016 · 4 comments
Closed

Class bodies shouldn't reference arguments in 1.11.0 #4320

monstersintokyo opened this issue Sep 26, 2016 · 4 comments

Comments

@monstersintokyo
Copy link

Define a class that defines an arguments object on the class prototype:

class Test
    arguments: null

Since CS 1.11 this is throwing: Class bodies shouldn't reference arguments

While it might be a questionable decision to name a variable like a keyword, the above example should still compile.

@monstersintokyo monstersintokyo changed the title Class bodies shouldn't reference arguments Class bodies shouldn't reference arguments in 1.11.0 Sep 26, 2016
@vendethiel
Copy link
Collaborator

vendethiel commented Sep 26, 2016

Interesting. I'm not sure what we changed there recently – because that warning has been added in 1.7.0. But I can confirm it works on 1.10.0

@lydell
Copy link
Collaborator

lydell commented Sep 26, 2016

I probably broke it in #4198.

@lydell lydell added the bug label Sep 26, 2016
@lydell
Copy link
Collaborator

lydell commented Sep 26, 2016

Workarounds:

class Test
    "#{}arguments": null
class Test
    @prototype.arguments = null'

@lydell lydell closed this as completed in 3204180 Sep 26, 2016
@lydell lydell added the fixed label Sep 26, 2016
JimPanic pushed a commit to GeoffreyBooth/coffeescript that referenced this issue Sep 26, 2016
`isLiteralArguments` mistakenly looked at `Literal`s instead of
`IdentifierLiteral`s.

This also gets rid of the ugly `.asKey` hack in nodes.coffee.

Fixes jashkenas#4320.
@monstersintokyo
Copy link
Author

That was fast - thank you both!

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

No branches or pull requests

3 participants