forked from Mirror/wren
- 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).
16 lines
287 B
Plaintext
16 lines
287 B
Plaintext
var A = Fiber.new {
|
|
System.print("transferred to A")
|
|
B.transferError("error!")
|
|
}
|
|
|
|
var B = Fiber.new {
|
|
System.print("started B")
|
|
A.transfer()
|
|
System.print("should not get here")
|
|
}
|
|
|
|
B.try()
|
|
// expect: started B
|
|
// expect: transferred to A
|
|
System.print(B.error) // expect: error!
|