Files
wren/test/fiber/run_when_done.wren
T

14 lines
307 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 {
2015-02-26 23:08:36 -08:00
a.run()
2014-04-14 07:23:05 -07:00
IO.print("nope")
}
2015-02-26 23:08:36 -08:00
b.call() // expect: run
a.run() // expect runtime error: Cannot run a finished fiber.