Write some more scope edge case tests.
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
var a = a == null
|
||||||
|
io.write(a) // expect: true
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// skip: Variables should not be in scope in their initializer.
|
||||||
|
{
|
||||||
|
var a = a + 1 // expect error
|
||||||
|
io.write(a)
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
var a = "outer"
|
||||||
|
{
|
||||||
|
io.write(a) // expect: outer
|
||||||
|
var a = "inner"
|
||||||
|
io.write(a) // expect: inner
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// skip: Variables should not be in scope in their initializer.
|
||||||
|
{
|
||||||
|
var a = "outer"
|
||||||
|
{
|
||||||
|
var a = a + " inner"
|
||||||
|
io.write(a) // expect: outer inner
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Test referring to class name inside class for class at global scope
|
||||||
|
// and in local scope.
|
||||||
Reference in New Issue
Block a user