We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@GeoffreyBooth I came across this while working on class AST:
This:
class A [b]: 3
compiles to:
var A; A = (function() { class A {}; A.prototype.[b] = 3; return A; }).call(this);
which doesn't parse
Does it make sense to allow computed class properties like this?
If so, it's probably just a question of omitting the . when compiling (so here generate A.prototype[b] = 3 instead)?
.
A.prototype[b] = 3
Fwiw, it looks like this didn't compile (as Coffeescript source) in Coffeescript 1.x. I didn't trace when it became allowed Coffeescript syntax
The text was updated successfully, but these errors were encountered:
For the static case, it's currently inconsistent as far as allowed syntax:
# this compiles class A @[b] = 3 # but this doesn't class A @[b]: 3
but the version that compiles (@[b] = 3) generates valid JS it appears (A[b] = 3)
@[b] = 3
A[b] = 3
Sorry, something went wrong.
I guess it might as well compile, since we support the same for objects since #4803. That might’ve been the PR where this broke for classes.
Can we fix this on master?
master
extract fix for jashkenas#5204
1650675
Class prototype property AST (#5205)
7b2fb18
* class prototype property AST * consistent naming * extract fix for #5204
Successfully merging a pull request may close this issue.
@GeoffreyBooth I came across this while working on class AST:
This:
compiles to:
which doesn't parse
Does it make sense to allow computed class properties like this?
If so, it's probably just a question of omitting the
.
when compiling (so here generateA.prototype[b] = 3
instead)?Fwiw, it looks like this didn't compile (as Coffeescript source) in Coffeescript 1.x. I didn't trace when it became allowed Coffeescript syntax
The text was updated successfully, but these errors were encountered: