mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-24 11:55:57 +00:00
try..catch vs loops
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16,7 +16,7 @@
|
||||
</define>
|
||||
<define append="true">
|
||||
<name>CONFIG::timeStamp</name>
|
||||
<value>'06.02.2021'</value>
|
||||
<value>'07.02.2021'</value>
|
||||
</define>
|
||||
<define append="true">
|
||||
<name>CONFIG::air</name>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</define>
|
||||
<define append="true">
|
||||
<name>CONFIG::timeStamp</name>
|
||||
<value>'06.02.2021'</value>
|
||||
<value>'07.02.2021'</value>
|
||||
</define>
|
||||
<define append="true">
|
||||
<name>CONFIG::air</name>
|
||||
|
||||
@@ -9,13 +9,14 @@ package
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class Main extends MovieClip
|
||||
{
|
||||
{
|
||||
TestTryCatch;
|
||||
TestTryCatchIfInTry;
|
||||
TestTryCatchInIf;
|
||||
TestTryCatchInWhile;
|
||||
TestTryCatchInWhile2;
|
||||
TestTryCatchInWhile3;
|
||||
TestTryCatchInWhile4;
|
||||
TestTryCatchLoop;
|
||||
TestTryCatchLoopBreak;
|
||||
TestTryCatchExceptionUsage
|
||||
|
||||
@@ -12,20 +12,20 @@ package tests
|
||||
{
|
||||
var a:int;
|
||||
a = 0;
|
||||
trace("before loop");
|
||||
while (a > 5)
|
||||
trace("before loop"); //1-17
|
||||
while (a > 5) //44-47
|
||||
{
|
||||
try
|
||||
{
|
||||
return "intry return";
|
||||
return "intry return"; //20-23
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
trace("in catch"); //26-43
|
||||
}
|
||||
a++;
|
||||
a++; //26-43 cont.
|
||||
}
|
||||
return "OK";
|
||||
return "OK";//48-50
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
37
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchInWhile4.as
vendored
Normal file
37
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchInWhile4.as
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatchInWhile4
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var a:int;
|
||||
a = 0;
|
||||
|
||||
while (true) {
|
||||
|
||||
try
|
||||
{
|
||||
trace("try2"); //12-21
|
||||
if (a == 10){
|
||||
trace("br");
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
trace("in catch2");
|
||||
}
|
||||
trace("a=" + a);
|
||||
}
|
||||
trace("after"); //61-66
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,59 +13,23 @@ package tests
|
||||
{
|
||||
var a:int;
|
||||
a = 0;
|
||||
trace("before loop");//1-15
|
||||
trace("before loop");
|
||||
try
|
||||
{
|
||||
trace("try1a");//16-22
|
||||
while (a < 10){ //34-37 loop0
|
||||
trace("a=" + a); //23-33
|
||||
trace("in try1");
|
||||
while (a < 10){
|
||||
trace("a=" + a);
|
||||
a++;
|
||||
}
|
||||
trace("try1b"); //38-44
|
||||
//45-45
|
||||
trace("in try2");
|
||||
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
trace("in catch"); //46-61
|
||||
trace("in catch");
|
||||
}
|
||||
|
||||
trace("middle");//62-68
|
||||
|
||||
|
||||
while (a < 20) { //104-107 loop1
|
||||
//69-69
|
||||
try
|
||||
{
|
||||
trace("try2"); //70-77
|
||||
return;
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
trace("in catch2"); //80-103
|
||||
}
|
||||
trace("a=" + a); //pokračuje 80-103
|
||||
}
|
||||
trace("middle2"); //108-114
|
||||
|
||||
while (true) { //161-161 loop2
|
||||
//115-115
|
||||
try
|
||||
{
|
||||
trace("try3"); //116-122
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
trace("in catch3"); //124-141
|
||||
break;
|
||||
}
|
||||
catch(e:EOFError)
|
||||
{
|
||||
trace("in catch4"); //141-159
|
||||
break;
|
||||
}
|
||||
//123-123
|
||||
}
|
||||
trace("exit"); //162-167
|
||||
trace("after");
|
||||
|
||||
}
|
||||
|
||||
|
||||
36
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchLoopBreak2.as
vendored
Normal file
36
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchLoopBreak2.as
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
package tests
|
||||
{
|
||||
import flash.errors.EOFError;
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatchLoopBreak2
|
||||
{
|
||||
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var a:int;
|
||||
a = 0;
|
||||
trace("before loop");
|
||||
|
||||
while (a < 20) {
|
||||
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
return;
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
trace("a=" + a);
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
41
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchLoopBreak3.as
vendored
Normal file
41
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchLoopBreak3.as
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
package tests
|
||||
{
|
||||
import flash.errors.EOFError;
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatchLoopBreak3
|
||||
{
|
||||
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var a:int;
|
||||
a = 0;
|
||||
trace("before loop");
|
||||
while (true) {
|
||||
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
trace("in catch1");
|
||||
break;
|
||||
}
|
||||
catch(e:EOFError)
|
||||
{
|
||||
trace("in catch2");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
trace("after");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user