mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-13 15:08:07 +00:00
renamed new as3 test swfs to have as3 prefix and unique SWF name
This commit is contained in:
37
libsrc/ffdec_lib/testdata/as3_cross_compile/src/Main.as
vendored
Normal file
37
libsrc/ffdec_lib/testdata/as3_cross_compile/src/Main.as
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import tests.*;
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class Main extends MovieClip
|
||||
{
|
||||
TestTryCatch;
|
||||
TestTryCatchIfInTry;
|
||||
TestTryCatchInWhile;
|
||||
TestTryCatchInWhile2;
|
||||
TestTryCatchLoop;
|
||||
TestTryCatchExceptionUsage
|
||||
TestTryFinally;
|
||||
TestTryFinallyDirectReturnInFinally;
|
||||
TestTryFinallyLoop;
|
||||
TestTryFinallyLoopInFinally;
|
||||
TestTryFinallyMultipleCatch;
|
||||
TestTryFinallyNoCatch;
|
||||
TestTryFinallyReturn;
|
||||
TestTryFinallyReturnInFinally;
|
||||
TestTryFinallyReturnNested;
|
||||
TestTryFinallyReturnVoid;
|
||||
|
||||
public function Main()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
26
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatch.as
vendored
Normal file
26
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatch.as
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatch
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
26
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchExceptionUsage.as
vendored
Normal file
26
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchExceptionUsage.as
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatchExceptionUsage
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("catched exception: "+e.message);
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
32
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchIfInTry.as
vendored
Normal file
32
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchIfInTry.as
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatchIfInTry
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var a:Boolean = true;
|
||||
trace("before");
|
||||
try
|
||||
{
|
||||
if (a)
|
||||
{
|
||||
trace("ret");
|
||||
return;
|
||||
}
|
||||
trace("in try");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
41
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchInWhile.as
vendored
Normal file
41
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchInWhile.as
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
package tests
|
||||
{
|
||||
import flash.errors.EOFError;
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatchInWhile
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
trace("before loop");
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
while (true)
|
||||
{
|
||||
trace("a");
|
||||
}
|
||||
//not reachable in ASC2
|
||||
//trace("after inner while");
|
||||
}
|
||||
catch (e:EOFError)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//not reachable in ASC2:
|
||||
//trace("after loop");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
48
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchInWhile2.as
vendored
Normal file
48
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchInWhile2.as
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
package tests
|
||||
{
|
||||
import flash.errors.EOFError;
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatchInWhile2
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var a:int;
|
||||
a = 0;
|
||||
trace("before loop");
|
||||
while (a > 5)
|
||||
{
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
if (a == 6){
|
||||
continue;
|
||||
}
|
||||
if (a == 7){
|
||||
break;
|
||||
}
|
||||
trace("after inner while");
|
||||
}
|
||||
catch (e:EOFError)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
if (a == 8){
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
a++;
|
||||
}
|
||||
//not reachable in ASC2:
|
||||
//trace("after loop");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
42
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchLoop.as
vendored
Normal file
42
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryCatchLoop.as
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
package tests
|
||||
{
|
||||
import flash.errors.EOFError;
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryCatchLoop
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
while (i < 100)
|
||||
{
|
||||
try
|
||||
{
|
||||
var j:int = 0;
|
||||
while (j < 20)
|
||||
{
|
||||
trace("a");
|
||||
j++;
|
||||
}
|
||||
}
|
||||
catch (e:EOFError)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
trace("after_try");
|
||||
i++;
|
||||
}
|
||||
trace("end");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
30
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinally.as
vendored
Normal file
30
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinally.as
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinally
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally");
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
34
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyDirectReturnInFinally.as
vendored
Normal file
34
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyDirectReturnInFinally.as
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyDirectReturnInFinally
|
||||
{
|
||||
|
||||
public function run() : String
|
||||
{
|
||||
|
||||
var str:String = "xxx";
|
||||
try
|
||||
{
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("error");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("hi ");
|
||||
if (str == "check")
|
||||
{
|
||||
return str;
|
||||
}
|
||||
return "hu" + str;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
41
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyLoop.as
vendored
Normal file
41
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyLoop.as
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyLoop
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
while (i < 10)
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
if (i == 5)
|
||||
{
|
||||
i += 5;
|
||||
trace("continue while");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally");
|
||||
}
|
||||
trace("after");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
41
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyLoopInFinally.as
vendored
Normal file
41
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyLoopInFinally.as
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyLoopInFinally
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
while (i < 10)
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (i == 5)
|
||||
{
|
||||
i += 7;
|
||||
trace("continue while");
|
||||
continue;
|
||||
}
|
||||
trace("in finally");
|
||||
}
|
||||
trace("after");
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
35
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyMultipleCatch.as
vendored
Normal file
35
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyMultipleCatch.as
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
package tests
|
||||
{
|
||||
import flash.errors.EOFError;
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyMultipleCatch
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch Error");
|
||||
}
|
||||
catch (e:EOFError)
|
||||
{
|
||||
trace("in catch EOFError");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally");
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
26
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyNoCatch.as
vendored
Normal file
26
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyNoCatch.as
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyNoCatch
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally");
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
42
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyReturn.as
vendored
Normal file
42
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyReturn.as
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyReturn
|
||||
{
|
||||
|
||||
public function run() : String
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
var a:int = 5;
|
||||
if (a > 4)
|
||||
{
|
||||
return "RET";
|
||||
}
|
||||
trace("between");
|
||||
if (a < 3)
|
||||
{
|
||||
return "RE2";
|
||||
}
|
||||
trace("in try2");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally");
|
||||
}
|
||||
trace("after");
|
||||
return "RETFINAL";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
44
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyReturnInFinally.as
vendored
Normal file
44
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyReturnInFinally.as
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyReturnInFinally
|
||||
{
|
||||
|
||||
public function run() : String
|
||||
{
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
var a:int = 5;
|
||||
if (a > 4)
|
||||
{
|
||||
return "RET";
|
||||
}
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally");
|
||||
if (a > 6){
|
||||
return "FINRET1";
|
||||
}
|
||||
trace("xx");
|
||||
if (a > 5){
|
||||
return "FINRET2";
|
||||
}
|
||||
trace("nofinret");
|
||||
}
|
||||
trace("after");
|
||||
return "RETEXIT";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
43
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyReturnNested.as
vendored
Normal file
43
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyReturnNested.as
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyReturnNested
|
||||
{
|
||||
|
||||
public function run() : String
|
||||
{
|
||||
var a:int = Math.random() * 5;
|
||||
try
|
||||
{
|
||||
trace("before try2");
|
||||
try
|
||||
{
|
||||
trace("in try2");
|
||||
if (a > 4)
|
||||
{
|
||||
return "RET";
|
||||
}
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally2");
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally1");
|
||||
}
|
||||
return "RETFINAL";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
36
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyReturnVoid.as
vendored
Normal file
36
libsrc/ffdec_lib/testdata/as3_cross_compile/src/tests/TestTryFinallyReturnVoid.as
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
package tests
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TestTryFinallyReturnVoid
|
||||
{
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
var a:int = Math.random() * 5;
|
||||
trace("before try");
|
||||
try
|
||||
{
|
||||
trace("in try");
|
||||
if (a > 4)
|
||||
{
|
||||
return;
|
||||
}
|
||||
trace("in try2");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("in catch");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("in finally");
|
||||
}
|
||||
trace("after");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user