mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
CoffeeScript-in-CoffeeScript can compile object[indexes]
This commit is contained in:
@@ -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) + ']'
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user