786: implemented dynamic object keys

This commit is contained in:
satyr
2010-10-24 14:05:31 +09:00
parent 291f377d40
commit 331036f86d
6 changed files with 117 additions and 53 deletions

View File

@@ -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