try in if fix

This commit is contained in:
Jindra Petřík
2021-02-07 22:28:50 +01:00
parent ebc8e86323
commit 16c2ec01ea
12 changed files with 108 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ package
TestTryCatch;
TestTryCatchIfInTry;
TestTryCatchInIf;
TestTryCatchInIf2;
TestTryCatchInWhile;
TestTryCatchInWhile2;
TestTryCatchInWhile3;

View File

@@ -0,0 +1,43 @@
package tests
{
/**
* ...
* @author JPEXS
*/
public class TestTryCatchInIf2
{
public function run():void
{
var a:int = Math.random();
if (a > 10)
{
try
{
trace("a");
return;
}
catch (e:Error)
{
trace("in catch 1");
}
}
else
{
try
{
trace("b");
}
catch (e:Error)
{
trace("in catch 2");
}
}
trace("after");
}
}
}

View File

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