If there any way to access outer class fields from inner class instance, EXCEPT passing outer class instance to inner class constructor?
To be more specific, I have a simple example:
class Test
constructor: (@number) ->
class SubTest
constructor: (@name) ->
toString: () ->
console.log @name, @number
getSubTest: () ->
return new SubTest "SubTest"
test = new Test 10
test.getSubTest().toString() # SubTest undefined
So, I want to get "SubTest 10" instead of "SubTest undefined". Is it possible?