mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
786: implemented dynamic object keys
This commit is contained in:
@@ -231,6 +231,21 @@ eq result.two, 2
|
||||
eq result.two, obj.list()[1]
|
||||
|
||||
|
||||
# Dynamic object keys.
|
||||
i = 0
|
||||
obj = {
|
||||
### leading comment ###
|
||||
"interpolated#{'key'}": 123
|
||||
(4 * 2): 8
|
||||
### cached shorthand ###
|
||||
(++i)
|
||||
### traling comment ###
|
||||
}
|
||||
eq obj.interpolatedkey, 123
|
||||
eq obj[8], 8
|
||||
eq obj[1], 1
|
||||
|
||||
|
||||
#542: Objects leading expression statement should be parenthesized.
|
||||
{f: -> ok yes }.f() + 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user