Files
wren/test/language/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
314 B
Plaintext

class Foo {
new { _field = "Foo field" }
closeOverGet {
return new Fn { _field }
}
closeOverSet {
return new Fn { _field = "new value" }
}
}
var foo = new Foo
IO.print(foo.closeOverGet.call()) // expect: Foo field
foo.closeOverSet.call()
IO.print(foo.closeOverGet.call()) // expect: new value