try..catch break detection fix

This commit is contained in:
Jindra Petřík
2021-02-07 13:47:46 +01:00
parent 8637d16022
commit e24f3b6d40
11 changed files with 100 additions and 12 deletions

View File

@@ -17,6 +17,7 @@ package
TestTryCatchInWhile2;
TestTryCatchInWhile3;
TestTryCatchInWhile4;
TestTryCatchInWhile5;
TestTryCatchLoop;
TestTryCatchLoopBreak;
TestTryCatchExceptionUsage

View File

@@ -12,20 +12,20 @@ package tests
{
var a:int;
a = 0;
trace("before loop"); //1-17
while (a > 5) //44-47
trace("before loop");
while (a > 5)
{
try
{
return "intry return"; //20-23
return "intry return";
}
catch(e:Error)
{
trace("in catch"); //26-43
trace("in catch");
}
a++; //26-43 cont.
a++;
}
return "OK";//48-50
return "OK";
}
}

View File

@@ -16,7 +16,7 @@ package tests
try
{
trace("try2"); //12-21
trace("try2");
if (a == 10){
trace("br");
break;
@@ -29,7 +29,7 @@ package tests
}
trace("a=" + a);
}
trace("after"); //61-66
trace("after");
}
}

View File

@@ -0,0 +1,36 @@
package tests
{
/**
* ...
* @author JPEXS
*/
public class TestTryCatchInWhile5
{
public function run() : void
{
var i:int;
i = 0;
var j:int;
j = 5;
while(i < 10)
{
try
{
trace("in try");
}
catch (e:Error)
{
if (j > 4) {
throw new Error("Problem: "+e);
}
}
i++;
}
trace("after");
}
}
}