Fixed goto/for detection

This commit is contained in:
Jindra Petřík
2021-01-22 20:46:44 +01:00
parent 6a94a5c274
commit 22c2206aec
9 changed files with 288 additions and 382 deletions

View File

@@ -38,6 +38,9 @@ package
TestForXml;
TestGotos;
TestGotos2;
TestGotos3;
TestGotos4;
TestGotos5;
TestHello;
TestIf;
TestIfElse;

View File

@@ -0,0 +1,33 @@
package tests
{
public class TestGotos3
{
public function run() : void
{
var a:int = 5;
if (a > 5)
{
for (var i:int = 0; i < 5; i++)
{
if (i > 3)
{
trace("A");
if (i == 4)
{
break;
}
}
trace("B");
}
}
else
{
trace("C");
}
trace("return");
}
}
}

View File

@@ -0,0 +1,28 @@
package tests
{
public class TestGotos4
{
public function run() : void
{
var a:int = 5;
if(a > 3)
{
if(a < 7)
{
try
{
trace("A");
}
catch(error:Error)
{
}
trace("B");
}
}
trace("return");
}
}
}

View File

@@ -0,0 +1,32 @@
package tests
{
public class TestGotos5
{
public function run() : void
{
var s:String = "A";
var i:int = 0;
for(; i < 10; i++)
{
if(s == "B")
{
if(s == "C")
{
continue;
}
}
trace("D");
var j:int = 0;
while(j < 29)
{
trace("E");
j++;
}
}
}
}
}