mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-18 13:49:59 +01:00
* Eliminate "new" reserved word. * Allow "this" before a method definition to define a constructor. * Only create a default constructor for classes that don't define one.
20 lines
296 B
Plaintext
20 lines
296 B
Plaintext
var b = Fiber.new {
|
|
IO.print("fiber b")
|
|
}
|
|
|
|
var a = Fiber.new {
|
|
IO.print("begin fiber a")
|
|
b.call()
|
|
IO.print("end fiber a")
|
|
}
|
|
|
|
IO.print("begin main")
|
|
a.call()
|
|
IO.print("end main")
|
|
|
|
// expect: begin main
|
|
// expect: begin fiber a
|
|
// expect: fiber b
|
|
// expect: end fiber a
|
|
// expect: end main
|