1
0
forked from Mirror/wren
Files
wren/test/core/fiber/abort_null.wren
Bob Nystrom b05a74da19 Revamp how runtime errors and fiber switching is handled.
- Add Fiber.transferError(_).
- Primitives place runtime errors directly in the fiber instead of on
  the stack.
- Primitives that change fibers set it directly in the VM.
- Allow a fiber's error to be any object (except null).
2015-09-29 22:57:03 -07:00

10 lines
246 B
Plaintext

var fiber = Fiber.new {
Fiber.abort(null)
System.print("get here") // expect: get here
Fiber.yield("value")
}
System.print(fiber.try()) // expect: value
System.print(fiber.isDone) // expect: false
System.print(fiber.error) // expect: null