Files
wren/test/static_field/closure.wren
T

17 lines
335 B
Plaintext
Raw Normal View History

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