2010-01-26 10:52:05 -05:00
|
|
|
Base: ->
|
|
|
|
Base::func: (string) ->
|
2009-12-28 23:08:02 -05:00
|
|
|
'zero/' + string
|
2009-12-24 19:23:23 -05:00
|
|
|
|
2010-01-26 10:52:05 -05:00
|
|
|
FirstChild: ->
|
2009-12-25 16:57:47 -05:00
|
|
|
FirstChild extends Base
|
2010-01-26 10:52:05 -05:00
|
|
|
FirstChild::func: (string) ->
|
2009-12-28 23:08:02 -05:00
|
|
|
super('one/') + string
|
2010-01-06 23:34:56 -05:00
|
|
|
|
2010-01-26 10:52:05 -05:00
|
|
|
SecondChild: ->
|
2009-12-25 16:57:47 -05:00
|
|
|
SecondChild extends FirstChild
|
2010-01-26 10:52:05 -05:00
|
|
|
SecondChild::func: (string) ->
|
2009-12-28 23:08:02 -05:00
|
|
|
super('two/') + string
|
2010-01-06 23:34:56 -05:00
|
|
|
|
2010-01-26 10:52:05 -05:00
|
|
|
ThirdChild: ->
|
2010-01-06 23:34:56 -05:00
|
|
|
this.array: [1, 2, 3]
|
2009-12-25 16:57:47 -05:00
|
|
|
ThirdChild extends SecondChild
|
2010-01-26 10:52:05 -05:00
|
|
|
ThirdChild::func: (string) ->
|
2009-12-28 23:08:02 -05:00
|
|
|
super('three/') + string
|
2009-12-24 19:23:23 -05:00
|
|
|
|
2010-01-24 23:40:45 -05:00
|
|
|
result: (new ThirdChild()).func 'four'
|
2009-12-24 19:23:23 -05:00
|
|
|
|
2010-01-24 23:40:45 -05:00
|
|
|
print result is 'zero/one/two/three/four'
|
2009-12-24 19:23:23 -05:00
|
|
|
|
2010-01-08 10:54:44 -05:00
|
|
|
|
2010-01-26 10:52:05 -05:00
|
|
|
TopClass: (arg) ->
|
2010-01-08 10:54:44 -05:00
|
|
|
this.prop: 'top-' + arg
|
|
|
|
|
2010-01-26 10:52:05 -05:00
|
|
|
SuperClass: (arg) ->
|
2010-01-24 23:40:45 -05:00
|
|
|
super 'super-' + arg
|
2010-01-08 10:54:44 -05:00
|
|
|
|
2010-01-26 10:52:05 -05:00
|
|
|
SubClass: ->
|
2010-01-24 23:40:45 -05:00
|
|
|
super 'sub'
|
2010-01-08 10:54:44 -05:00
|
|
|
|
|
|
|
SuperClass extends TopClass
|
|
|
|
SubClass extends SuperClass
|
|
|
|
|
|
|
|
print((new SubClass()).prop is 'top-super-sub')
|