mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
allowing Klass::['dynamic-property'] syntax. Issue #392
This commit is contained in:
@@ -55,6 +55,8 @@ ok (new TwoClass('three')).name is 'three'
|
||||
Base: ->
|
||||
Base::func: (string) ->
|
||||
'zero/' + string
|
||||
Base::['func-func']: (string) ->
|
||||
"dynamic-$string"
|
||||
|
||||
FirstChild: ->
|
||||
FirstChild extends Base
|
||||
@@ -77,6 +79,8 @@ result: (new ThirdChild()).func 'four'
|
||||
|
||||
ok result is 'zero/one/two/three/four'
|
||||
|
||||
ok (new ThirdChild())['func-func']('thing') is 'dynamic-thing'
|
||||
|
||||
|
||||
TopClass: (arg) ->
|
||||
@prop: 'top-' + arg
|
||||
|
||||
Reference in New Issue
Block a user