allowing Klass::['dynamic-property'] syntax. Issue #392

This commit is contained in:
Jeremy Ashkenas
2010-05-31 22:32:43 -04:00
parent b8a4adbdc7
commit 45f442bd73
10 changed files with 178 additions and 167 deletions

View File

@@ -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