Files
wren/test/this/nested_closure.wren
T

17 lines
255 B
Plaintext
Raw Normal View History

2013-12-21 15:55:08 -08:00
class Foo {
getClosure {
return fn {
return fn {
return fn {
return this.toString
}
}
}
}
toString { return "Foo" }
}
var closure = (new Foo).getClosure
2014-01-05 12:27:12 -08:00
IO.print(closure.call.call.call) // expect: Foo