mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
adding '::' as shorthand for '.prototype.'
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
Base: =>
|
||||
Base.prototype.func: string =>
|
||||
Base::func: string =>
|
||||
'zero/' + string
|
||||
|
||||
FirstChild: =>
|
||||
FirstChild extends Base
|
||||
FirstChild.prototype.func: string =>
|
||||
FirstChild::func: string =>
|
||||
super('one/') + string
|
||||
|
||||
SecondChild: =>
|
||||
SecondChild extends FirstChild
|
||||
SecondChild.prototype.func: string =>
|
||||
SecondChild::func: string =>
|
||||
super('two/') + string
|
||||
|
||||
ThirdChild: =>
|
||||
this.array: [1, 2, 3]
|
||||
ThirdChild extends SecondChild
|
||||
ThirdChild.prototype.func: string =>
|
||||
ThirdChild::func: string =>
|
||||
super('three/') + string
|
||||
|
||||
result: (new ThirdChild()).func('four')
|
||||
|
||||
Reference in New Issue
Block a user