forked from Mirror/wren
It's pretty bare bones now, but it lets you get a reference to an object from a foreign call and then return it later.
15 lines
293 B
Plaintext
15 lines
293 B
Plaintext
class Api {
|
|
foreign static value=(value)
|
|
foreign static value
|
|
}
|
|
|
|
Api.value = ["list", "of", "strings"]
|
|
|
|
// Do some stuff to trigger a GC (at least when GC stress testing enabled).
|
|
var s = "string"
|
|
for (i in 1...10) {
|
|
s = s + " more"
|
|
}
|
|
|
|
IO.print(Api.value) // expect: [list, of, strings]
|