Files
wren/test/language/static_field/closure.wren
T
Bob Nystrom 64eccdd9be Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
2015-03-14 12:45:56 -07:00

17 lines
342 B
Plaintext

class Foo {
static initialize { __field = "Foo field" }
static closeOverGet {
return new Fn { __field }
}
static closeOverSet {
return new 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