CoffeeScript-in-CoffeeScript can compile object[indexes]

This commit is contained in:
Jeremy Ashkenas
2010-02-08 23:45:46 -05:00
parent cb57a1ca1f
commit 863de88671
2 changed files with 24 additions and 1 deletions

View File

@@ -460,6 +460,19 @@ AccessorNode: exports.AccessorNode: inherit Node, {
}
# An indexed accessor into a part of an array or object.
IndexNode: exports.IndexNode: inherit Node, {
constructor: (index) ->
@children: [@index: index]
this
compile_node: (o) ->
'[' + @index.compile(o) + ']'
}