Files
wren/test/this/closure.wren
T

13 lines
185 B
Plaintext
Raw Normal View History

2013-12-21 15:55:08 -08:00
class Foo {
getClosure {
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) // expect: Foo