mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
Removing the notion of a ThisNode so that we don't have to worry about the special cases. Fixes Issue 180
This commit is contained in:
@@ -240,7 +240,7 @@ ValueNode: exports.ValueNode: inherit Node, {
|
||||
this
|
||||
|
||||
has_properties: ->
|
||||
@properties.length or @base instanceof ThisNode
|
||||
!!@properties.length
|
||||
|
||||
is_array: ->
|
||||
@base instanceof ArrayNode and not @has_properties()
|
||||
@@ -423,19 +423,6 @@ IndexNode: exports.IndexNode: inherit Node, {
|
||||
|
||||
}
|
||||
|
||||
# A this-reference, using '@'.
|
||||
ThisNode: exports.ThisNode: inherit Node, {
|
||||
type: 'This'
|
||||
|
||||
constructor: (property) ->
|
||||
@property: property or null
|
||||
this
|
||||
|
||||
compile_node: (o) ->
|
||||
'this' + (if @property then '.' + @property.compile(o) else '')
|
||||
|
||||
}
|
||||
|
||||
# A range literal. Ranges can be used to extract portions (slices) of arrays,
|
||||
# or to specify a range for list comprehensions.
|
||||
RangeNode: exports.RangeNode: inherit Node, {
|
||||
|
||||
Reference in New Issue
Block a user