Skip to content

Loading…

No warning when using a variable named "_super" in a non-base class method #2459

Closed
almost opened this Issue · 1 comment

2 participants

@almost

If you use a variable called "_super" in a method of a class which inherits from another class then that variable is taken to refer to the super class and is shared between all other instances of the class. This is super confusing. I'm fine with not using variables which that name but if I do it should raise an error or at least a warning!!

See: http://coffeescript.org/#try:class%20WTF%0A%0Aclass%20Fuuuuuuuuuu%20extends%20WTF%0A%20%20wtf%3A%20-%3E%0A%20%20%20_super%20%3D%20'super'

@michaelficarra
Collaborator

Duplicate of #2125 and #1574. This requires two pass variable naming.

edit: typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.