Fixed: #270 AS decompilation - switch in loop

This commit is contained in:
Jindra Petřík
2021-03-13 18:30:05 +01:00
parent 9b13ca6504
commit 09b68c1f9c
11 changed files with 260 additions and 7 deletions

View File

@@ -43,7 +43,9 @@ package
TestForEachReturn;
TestForGoto;
TestForIn;
TestForInIf;
TestForInReturn;
TestForInSwitch;
TestForXml;
TestGotos;
TestGotos2;
@@ -56,6 +58,7 @@ package
TestIf;
TestIfElse;
TestIfInIf;
TestIfTry;
TestIgnoreAndOr;
TestImportedVar;
TestInc2;

View File

@@ -0,0 +1,24 @@
package tests
{
public class TestForInIf
{
public function run():*
{
var arr:Array = ["a", "b", "c"];
var b:int = 5;
for (var a:String in arr){
if (b == 5){
if (b > 7){
trace("b>7");
}else{
return;
}
}
trace("forend");
}
}
}
}

View File

@@ -0,0 +1,27 @@
package tests
{
public class TestForInSwitch
{
public function run():*
{
var arr:Array = ["a", "b", "c"];
for (var a:String in arr){
switch(a){
case "a":
trace("val a");
break;
case "b":
trace("val b");
break;
case "c":
trace("val c");
//break;
}
trace("final");
}
}
}
}

View File

@@ -5,7 +5,7 @@ package tests
{
public function run():*
{
trace("hello");
trace("hello");
}
}
}

View File

@@ -0,0 +1,28 @@
package tests
{
public class TestIfTry
{
public function run():*
{
var b:Boolean = true;
if (b)
{
var c:int = 5;
for (var i:int = 0; i < c; i++)
{
trace("xx");
}
}
try
{
trace("in try");
}
catch (e:Error)
{
trace("in catch");
}
}
}
}