mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +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.
26 lines
310 B
Plaintext
26 lines
310 B
Plaintext
var f = null
|
|
var g = null
|
|
|
|
{
|
|
var local = "local"
|
|
f = Fn.new {
|
|
IO.print(local)
|
|
local = "after f"
|
|
IO.print(local)
|
|
}
|
|
|
|
g = Fn.new {
|
|
IO.print(local)
|
|
local = "after g"
|
|
IO.print(local)
|
|
}
|
|
}
|
|
|
|
f.call()
|
|
// expect: local
|
|
// expect: after f
|
|
|
|
g.call()
|
|
// expect: after f
|
|
// expect: after g
|