Files
wren/test/language/variable/scope_if.wren
T

14 lines
265 B
Plaintext
Raw Normal View History

2013-11-18 09:19:03 -08:00
// Create a local scope for the 'then' expression.
var a = "out"
2013-12-04 07:43:50 -08:00
if (true) {
var a = "in"
}
2015-09-15 07:46:09 -07:00
System.print(a) // expect: out
2013-11-18 09:19:03 -08:00
// Create a local scope for the 'else' expression.
var b = "out"
2013-12-04 07:43:50 -08:00
if (false) "dummy" else {
var b = "in"
}
2015-09-15 07:46:09 -07:00
System.print(b) // expect: out