Files
wren/test/language/static_field/closure.wren
T

17 lines
350 B
Plaintext
Raw Normal View History

2014-01-19 13:01:51 -08:00
class Foo {
static initialize { __field = "Foo field" }
static closeOverGet {
2015-07-10 09:18:22 -07:00
return Fn.new { __field }
2014-01-19 13:01:51 -08:00
}
static closeOverSet {
2015-07-10 09:18:22 -07:00
return Fn.new { __field = "new value" }
2014-01-19 13:01:51 -08:00
}
}
Foo.initialize
2015-09-15 07:46:09 -07:00
System.print(Foo.closeOverGet.call()) // expect: Foo field
2015-02-26 23:08:36 -08:00
Foo.closeOverSet.call()
2015-09-15 07:46:09 -07:00
System.print(Foo.closeOverGet.call()) // expect: new value