mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
adding @property for this.property
This commit is contained in:
@@ -429,6 +429,18 @@ module CoffeeScript
|
||||
end
|
||||
end
|
||||
|
||||
# A this-reference, using '@'.
|
||||
class ThisNode < Node
|
||||
def initialize(property=nil)
|
||||
@property = property
|
||||
end
|
||||
|
||||
def compile_node(o)
|
||||
prop = @property ? ".#{@property}" : ''
|
||||
write("this#{prop}")
|
||||
end
|
||||
end
|
||||
|
||||
# A range literal. Ranges can be used to extract portions (slices) of arrays,
|
||||
# or to specify a range for array comprehensions.
|
||||
class RangeNode < Node
|
||||
|
||||
Reference in New Issue
Block a user