Support computed object keys
Closed this issue · 1 comments
jhessin commented
The following line compiles without issue in coffeescript 2.2.1
path = new Path {
fromPath: @
toPath: if @isCollection
ref.id
else
# because coffeelint shows an error here!
# coffeelint: disable=coffeescript_error
[Path.DEFAULT_COLLECTION]: ref.id
# coffeelint: enable=coffeescript_error
}
However as noted in the comments this type of structure is not recognized as valid by coffeelint 2.0.7 as noted here
✗ cs/controllers/Path.coffee
✗ #57: [stdin]:57:9: error: unexpected [
[Path.DEFAULT_COLLECTION]: ref.id
^.
✗ Lint! » 1 error and 0 warnings in 1 file
swang commented
The issue was coffeescript had a bug in 2.0.3. I published 2.1.0 that should fix this.