Files
wren/test/static_field/closure.wren
T

17 lines
336 B
Plaintext
Raw Normal View History

2014-01-19 13:01:51 -08:00
class Foo {
static initialize { __field = "Foo field" }
static closeOverGet {
2014-04-02 19:41:53 -07:00
return new Fn { __field }
2014-01-19 13:01:51 -08:00
}
static closeOverSet {
2014-04-02 19:41:53 -07:00
return new Fn { __field = "new value" }
2014-01-19 13:01:51 -08:00
}
}
Foo.initialize
IO.print(Foo.closeOverGet.call) // expect: Foo field
Foo.closeOverSet.call
IO.print(Foo.closeOverGet.call) // expect: new value