-
Notifications
You must be signed in to change notification settings - Fork 2k
calling super
in methods defined on namespaced classes
#1392
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
Comments
Note: the caching I recommend above will protect us from multiple execution in cases such as
will invoke the |
Yes -- I think that's quite acceptable. Expected, even. If your class call is a factory that's producing instances of new classes, you'd expect the one you used to define your prototype to also be used when you call |
As discussed in jashkenas#3039 (comment). This is the first step to implement dynamic object literal keys (see jashkenas#3597). This also fixes jashkenas#1392. In short, `super` is now allowed: # in class definitions: class A instanceMethod: -> super @staticmethod: -> super @staticMethod2 = -> super # in assignment where the next to last property is 'prototype': A::m = -> super A['prototype'].m = -> super a.b()[5]::m = -> super A::[x()] = -> super class B @::m = -> super
As discussed in jashkenas#3039 (comment). This is the first step to implement dynamic object literal keys (see jashkenas#3597). This also fixes jashkenas#1392. In short, `super` is now allowed: # in class definitions: class A instanceMethod: -> super @staticmethod: -> super @staticMethod2 = -> super # in assignment where the next to last property is 'prototype': A::m = -> super A['prototype'].m = -> super a.b()[5]::m = -> super A::[x()] = -> super class B @::m = -> super
As discussed in jashkenas#3039 (comment). This is the first step to implement dynamic object literal keys (see jashkenas#3597). This also fixes jashkenas#1392. In short, `super` is now allowed: # in class definitions: class A instanceMethod: -> super @staticmethod: -> super @staticMethod2 = -> super # in assignment where the next to last property is 'prototype': A::m = -> super A['prototype'].m = -> super a.b()[5]::m = -> super A::[x()] = -> super class B @::m = -> super
As discussed in jashkenas#3039 (comment). This is the first step to implement dynamic object literal keys (see jashkenas#3597). This also fixes jashkenas#1392. In short, `super` is now allowed: # in class definitions: class A instanceMethod: -> super @staticmethod: -> super @staticMethod2 = -> super # in assignment where the next to last access is 'prototype': A::m = -> super A.prototype.m = -> super a.b()[5]::m = -> super A::[x()] = -> super class B @::m = -> super
As discussed in jashkenas#3039 (comment). This is the first step to implement dynamic object literal keys (see jashkenas#3597). This also fixes jashkenas#1392. In short, `super` is now allowed: # in class definitions: class A instanceMethod: -> super @staticmethod: -> super @staticMethod2 = -> super # in assignment where the next to last access is 'prototype': A::m = -> super A.prototype.m = -> super a.b()[5]::m = -> super A::[x()] = -> super class B @::m = -> super
As discussed in jashkenas#3039 (comment). This is the first step to implement dynamic object literal keys (see jashkenas#3597). This also fixes jashkenas#1392. In short, `super` is now allowed: # in class definitions: class A instanceMethod: -> super @staticmethod: -> super @staticMethod2 = -> super # in assignment where the next to last access is 'prototype': A::m = -> super A.prototype.m = -> super a.b()[5]::m = -> super A::[x()] = -> super class B @::m = -> super
C::m = -> super
compiles correctly intonamespaced.C::m = -> super"
compiles incorrectly intoProper compilation would have been
The error originates from the
METHOD_DEF
regex being used byAssign::compileNode
matching only identifiers.Call::superReference
is then compiling incorrectly.The text was updated successfully, but these errors were encountered: