Files
wren/test/fiber/run_when_done.wren
T

14 lines
300 B
Plaintext
Raw Normal View History

2014-04-14 07:23:05 -07:00
var a = new Fiber {
2014-01-13 06:58:27 -08:00
IO.print("run")
2014-04-02 17:31:58 -07:00
}
2014-01-13 06:58:27 -08:00
2014-04-14 07:23:05 -07:00
// Run a through an intermediate fiber since it will get discarded and we need
// to return to the main one after a completes.
var b = new Fiber {
a.run
IO.print("nope")
}
b.call // expect: run
a.run // expect runtime error: Cannot run a finished fiber.