mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-16 20:28:04 +01:00
- Compile them as calls and definitions. - Use them for call(), clear(), run(), try(), and yield(). - Update the docs.
14 lines
405 B
Plaintext
14 lines
405 B
Plaintext
// This is a regression test. There was a bug where if an upvalue for an
|
|
// earlier local (here "a") was captured *after* a later one ("b"), then Wren
|
|
// would crash because it walked to the end of the upvalue list (correct), but
|
|
// then didn't handle not finding the variable.
|
|
|
|
new Fn {
|
|
var a = "a"
|
|
var b = "b"
|
|
new Fn {
|
|
IO.print(b) // expect: b
|
|
IO.print(a) // expect: a
|
|
}.call()
|
|
}.call()
|