Add Fiber.abort() method.

This commit is contained in:
Bob Nystrom
2015-01-01 10:40:14 -08:00
parent 93ced56a7a
commit c967439ead
4 changed files with 19 additions and 0 deletions

7
test/fiber/abort.wren Normal file
View File

@ -0,0 +1,7 @@
var fiber = new Fiber {
Fiber.abort("Error message.")
}
IO.print(fiber.try) // expect: Error message.
IO.print(fiber.isDone) // expect: true
IO.print(fiber.error) // expect: Error message.

View File

@ -0,0 +1 @@
Fiber.abort("Abort!") // expect runtime error: Abort!

View File

@ -0,0 +1 @@
Fiber.abort(123) // expect runtime error: Error message must be a string.