mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-25 18:35:10 +00:00
AS3 test methods separated to classes, Fixed AS3: get/set slot for global scope
This commit is contained in:
91
libsrc/ffdec_lib/testdata/flashdevelop/src/Main.as
vendored
Normal file
91
libsrc/ffdec_lib/testdata/flashdevelop/src/Main.as
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
package
|
||||
{
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import tests.*;
|
||||
import tests_classes.mypackage1.SetupMyPackage1;
|
||||
import tests_classes.mypackage2.SetupMyPackage2;
|
||||
import tests_classes.mypackage3.SetupMyPackage3;
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class Main extends Sprite
|
||||
{
|
||||
TestArguments;
|
||||
TestCatchFinally;
|
||||
TestChain2;
|
||||
TestChainedAssignments;
|
||||
TestComplexExpressions;
|
||||
TestContinueLevels;
|
||||
TestDecl2;
|
||||
TestDeclarations;
|
||||
TestDefaultNotLastGrouped;
|
||||
TestDoWhile;
|
||||
TestDoWhile2;
|
||||
TestExpressions;
|
||||
TestFinallyZeroJump;
|
||||
TestFor;
|
||||
TestForBreak;
|
||||
TestForContinue;
|
||||
TestForEach;
|
||||
TestForEachObjectArray;
|
||||
TestForEachObjectAttribute;
|
||||
TestForIn;
|
||||
TestHello;
|
||||
TestIf;
|
||||
TestIfElse;
|
||||
TestInc2;
|
||||
TestIncDec;
|
||||
TestInlineFunctions;
|
||||
TestInnerFunctions;
|
||||
TestInnerIf;
|
||||
TestInnerTry;
|
||||
TestLogicalComputing;
|
||||
TestManualConvert;
|
||||
TestMissingDefault;
|
||||
TestMultipleCondition;
|
||||
TestNamedAnonFunctions;
|
||||
TestNames;
|
||||
TestOptionalParameters;
|
||||
TestParamNames;
|
||||
TestParamsCount;
|
||||
TestPrecedence;
|
||||
TestPrecedenceX;
|
||||
TestProperty;
|
||||
TestRegExp;
|
||||
TestRest;
|
||||
TestStringConcat;
|
||||
TestStrings;
|
||||
TestSwitch;
|
||||
TestSwitchDefault;
|
||||
TestTernarOperator;
|
||||
TestTry;
|
||||
TestTryReturn;
|
||||
TestVector;
|
||||
TestVector2;
|
||||
TestWhileAnd;
|
||||
TestWhileContinue;
|
||||
TestWhileTry;
|
||||
TestWhileTry2;
|
||||
|
||||
SetupMyPackage1;
|
||||
SetupMyPackage2;
|
||||
SetupMyPackage3;
|
||||
|
||||
public function Main()
|
||||
{
|
||||
if (stage) init();
|
||||
else addEventListener(Event.ADDED_TO_STAGE, init);
|
||||
}
|
||||
|
||||
private function init(e:Event = null):void
|
||||
{
|
||||
removeEventListener(Event.ADDED_TO_STAGE, init);
|
||||
// entry point
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
11
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestArguments.as
vendored
Normal file
11
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestArguments.as
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestArguments
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
return arguments[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
24
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestCatchFinally.as
vendored
Normal file
24
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestCatchFinally.as
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestCatchFinally
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
try
|
||||
{
|
||||
a = 9;
|
||||
trace("intry");
|
||||
}
|
||||
catch (e:*)
|
||||
{
|
||||
trace("incatch");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("infinally");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestChain2.as
vendored
Normal file
30
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestChain2.as
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestChain2
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var g:Array = null;
|
||||
var h:Boolean = false;
|
||||
var extraLine:Boolean = false;
|
||||
var r:int = 7;
|
||||
var t:int = 0;
|
||||
t = this.getInt();
|
||||
if (t + 1 < g.length)
|
||||
{
|
||||
t++;
|
||||
h = true;
|
||||
}
|
||||
if (t >= 0)
|
||||
{
|
||||
trace("ch");
|
||||
}
|
||||
}
|
||||
|
||||
private function getInt():int
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
49
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestChainedAssignments.as
vendored
Normal file
49
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestChainedAssignments.as
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestChainedAssignments
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:int = 0;
|
||||
var b:int = 0;
|
||||
var c:int = 0;
|
||||
var d:int = 0;
|
||||
d = c = b = a = 5;
|
||||
var e:TestClass2 = TestClass2.createMe("test");
|
||||
e.attrib1 = e.attrib2 = e.attrib3 = this.getCounter();
|
||||
this.traceIt(e.toString());
|
||||
}
|
||||
|
||||
private function getCounter() : int
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
private function traceIt(s:String) : void
|
||||
{
|
||||
trace(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass2 {
|
||||
public var attrib1:int;
|
||||
public var attrib2:int;
|
||||
public var attrib3:int;
|
||||
|
||||
public function TestClass2(a1:String)
|
||||
{
|
||||
trace("Class2 construct");
|
||||
}
|
||||
|
||||
public static function createMe(a1:String):TestClass2
|
||||
{
|
||||
return new TestClass2(a1);
|
||||
}
|
||||
|
||||
public function toString() : String
|
||||
{
|
||||
return "tc2";
|
||||
}
|
||||
}
|
||||
13
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestComplexExpressions.as
vendored
Normal file
13
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestComplexExpressions.as
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestComplexExpressions
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
j = i = i + (i = i + i++);
|
||||
}
|
||||
}
|
||||
}
|
||||
66
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestContinueLevels.as
vendored
Normal file
66
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestContinueLevels.as
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestContinueLevels
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
loop123: switch (a)
|
||||
{
|
||||
case 57 * a:
|
||||
trace("fiftyseven multiply a");
|
||||
var b:* = 0;
|
||||
while (b < 50)
|
||||
{
|
||||
if (b == 10)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (b == 15)
|
||||
{
|
||||
break loop123;
|
||||
}
|
||||
b = b + 1;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
trace("thirteen");
|
||||
case 14:
|
||||
trace("fourteen");
|
||||
break;
|
||||
case 89:
|
||||
trace("eightynine");
|
||||
break;
|
||||
default:
|
||||
trace("default clause");
|
||||
}
|
||||
|
||||
loop182: for (var c:* = 0; c < 8; c = c + 1)
|
||||
{
|
||||
|
||||
loop165: for (var d:* = 0; d < 25; d++)
|
||||
{
|
||||
|
||||
for (var e:* = 0; e < 50; e++)
|
||||
{
|
||||
if (e == 9)
|
||||
{
|
||||
break loop165;
|
||||
}
|
||||
if (e == 20)
|
||||
{
|
||||
continue loop182;
|
||||
}
|
||||
if (e == 8)
|
||||
{
|
||||
break;
|
||||
}
|
||||
break loop182;
|
||||
}
|
||||
}
|
||||
trace("hello");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDecl2.as
vendored
Normal file
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDecl2.as
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestDecl2
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var k:int = 0;
|
||||
var i:int = 5;
|
||||
i = i + 7;
|
||||
if (i == 5)
|
||||
{
|
||||
if (i < 8)
|
||||
{
|
||||
k = 6;
|
||||
}
|
||||
}
|
||||
k = 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDeclarations.as
vendored
Normal file
30
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDeclarations.as
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestDeclarations
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var vall:* = undefined;
|
||||
var vstr:String = null;
|
||||
var vint:int = 0;
|
||||
var vuint:uint = 0;
|
||||
var vclass:TestClass1 = null;
|
||||
var vnumber:Number = NaN;
|
||||
var vobject:Object = null;
|
||||
vall = 6;
|
||||
vstr = "hello";
|
||||
vuint = 7;
|
||||
vint = -4;
|
||||
vclass = new TestClass1();
|
||||
vnumber = 0.5;
|
||||
vnumber = 6;
|
||||
vobject = vclass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass1
|
||||
{
|
||||
|
||||
}
|
||||
23
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDefaultNotLastGrouped.as
vendored
Normal file
23
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDefaultNotLastGrouped.as
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestDefaultNotLastGrouped
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var k:* = 10;
|
||||
switch (k)
|
||||
{
|
||||
default:
|
||||
case "six":
|
||||
trace("def and 6");
|
||||
case "five":
|
||||
trace("def and 6 and 5");
|
||||
break;
|
||||
case "four":
|
||||
trace("4");
|
||||
}
|
||||
trace("after switch");
|
||||
}
|
||||
}
|
||||
}
|
||||
17
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDoWhile.as
vendored
Normal file
17
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDoWhile.as
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestDoWhile
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 8;
|
||||
do
|
||||
{
|
||||
trace("a=" + a);
|
||||
a++;
|
||||
} while (a < 20);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
26
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDoWhile2.as
vendored
Normal file
26
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestDoWhile2.as
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestDoWhile2
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var k:int = 5;
|
||||
do
|
||||
{
|
||||
k++;
|
||||
if (k == 7)
|
||||
{
|
||||
k = 5 * k;
|
||||
}
|
||||
else
|
||||
{
|
||||
k = 5 - k;
|
||||
}
|
||||
k--;
|
||||
} while (k < 9);
|
||||
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestExpressions.as
vendored
Normal file
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestExpressions.as
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestExpressions
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var arr:Array = null;
|
||||
var i:int = 5;
|
||||
var j:int = 5;
|
||||
if ((i = i = i / 2) == 1 || i == 2)
|
||||
{
|
||||
arguments.concat(i);
|
||||
}
|
||||
else if (i == 0)
|
||||
{
|
||||
i = j++;
|
||||
}
|
||||
else
|
||||
{
|
||||
arr[0]();
|
||||
}
|
||||
|
||||
return i == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestFinallyZeroJump.as
vendored
Normal file
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestFinallyZeroJump.as
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestFinallyZeroJump
|
||||
{
|
||||
public function run(param1:String) : String
|
||||
{
|
||||
var str:String = param1;
|
||||
try
|
||||
{
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("error is :" + e.message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("hi ");
|
||||
if (5 == 4)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
return "hu" + str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestFor.as
vendored
Normal file
14
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestFor.as
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestFor
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
for (var a:* = 0; a < 10; a++)
|
||||
{
|
||||
trace("a=" + a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForBreak.as
vendored
Normal file
18
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForBreak.as
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestForBreak
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
for (var a:* = 0; a < 10; a++)
|
||||
{
|
||||
if (a == 5)
|
||||
{
|
||||
break;
|
||||
}
|
||||
trace("hello:" + a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForContinue.as
vendored
Normal file
33
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForContinue.as
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestForContinue
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
for (var a:* = 0; a < 10; a = a + 1)
|
||||
{
|
||||
if (a == 9)
|
||||
{
|
||||
if (a == 5)
|
||||
{
|
||||
trace("part1");
|
||||
continue;
|
||||
}
|
||||
trace("a=" + a);
|
||||
if (a == 7)
|
||||
{
|
||||
trace("part2");
|
||||
continue;
|
||||
}
|
||||
trace("part3");
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("part4");
|
||||
}
|
||||
trace("part5");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForEach.as
vendored
Normal file
20
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForEach.as
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestForEach
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var list:Array = null;
|
||||
var item:* = undefined;
|
||||
list = new Array();
|
||||
list[0] = "first";
|
||||
list[1] = "second";
|
||||
list[2] = "third";
|
||||
for each (item in list)
|
||||
{
|
||||
trace("item #" + item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
22
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForEachObjectArray.as
vendored
Normal file
22
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForEachObjectArray.as
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestForEachObjectArray
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var list:Array = null;
|
||||
var test:Array = null;
|
||||
list = new Array();
|
||||
list[0] = "first";
|
||||
list[1] = "second";
|
||||
list[2] = "third";
|
||||
test = new Array();
|
||||
test[0] = 0;
|
||||
for each (test[0] in list)
|
||||
{
|
||||
trace("item #" + test[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForEachObjectAttribute.as
vendored
Normal file
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForEachObjectAttribute.as
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestForEachObjectAttribute
|
||||
{
|
||||
private var testPriv:int = 5;
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var list:Array = null;
|
||||
list = new Array();
|
||||
list[0] = "first";
|
||||
list[1] = "second";
|
||||
list[2] = "third";
|
||||
for each (this.testPriv in list)
|
||||
{
|
||||
trace("item #" + this.testPriv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForIn.as
vendored
Normal file
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestForIn.as
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
package tests
|
||||
{
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
public class TestForIn
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var dic:Dictionary = null;
|
||||
var item:* = null;
|
||||
for (item in dic)
|
||||
{
|
||||
trace(item);
|
||||
}
|
||||
for each (item in dic)
|
||||
{
|
||||
trace(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestHello.as
vendored
Normal file
11
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestHello.as
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestHello
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
trace("hello");
|
||||
}
|
||||
}
|
||||
}
|
||||
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestIf.as
vendored
Normal file
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestIf.as
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIf
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
if (a == 7)
|
||||
{
|
||||
trace("onTrue");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestIfElse.as
vendored
Normal file
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestIfElse.as
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIfElse
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
if (a == 7)
|
||||
{
|
||||
trace("onTrue");
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("onFalse");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInc2.as
vendored
Normal file
23
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInc2.as
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestInc2
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = [1];
|
||||
a[this.getInt()]++;
|
||||
var d:* = a[this.getInt()]++;
|
||||
var e:* = ++a[this.getInt()];
|
||||
var b:* = 1;
|
||||
b++;
|
||||
var c:* = 1;
|
||||
b = c++;
|
||||
}
|
||||
|
||||
private function getInt():int
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
49
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestIncDec.as
vendored
Normal file
49
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestIncDec.as
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
var b:* = 0;
|
||||
trace("++var");
|
||||
b = ++a;
|
||||
trace("var++");
|
||||
b = a++;
|
||||
trace("--var");
|
||||
b = --a;
|
||||
trace("var--");
|
||||
b = a--;
|
||||
var c:* = [1, 2, 3, 4, 5];
|
||||
trace("++arr");
|
||||
b = ++c[2];
|
||||
trace("arr++");
|
||||
b = c[2]++;
|
||||
trace("--arr");
|
||||
b = --c[2];
|
||||
trace("arr--");
|
||||
b = c[2]--;
|
||||
var d:* = new TestClass1();
|
||||
trace("++property");
|
||||
trace(++d.attrib);
|
||||
trace("property++");
|
||||
trace(d.attrib++);
|
||||
trace("--property");
|
||||
trace(--d.attrib);
|
||||
trace("property--");
|
||||
trace(d.attrib--);
|
||||
trace("arr[e++]");
|
||||
var chars:Array = new Array(36);
|
||||
var index:uint = 0;
|
||||
chars[index++] = 5;
|
||||
trace("arr[++e]");
|
||||
chars[++index] = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass1
|
||||
{
|
||||
public var attrib:int = 5;
|
||||
}
|
||||
25
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInlineFunctions.as
vendored
Normal file
25
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInlineFunctions.as
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestInlineFunctions
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var first:String="value1";
|
||||
var traceParameter:Function=function(aParam:String):String
|
||||
{
|
||||
var second:String="value2";
|
||||
second=second + "cc";
|
||||
var traceParam2:Function=function(bParam:String):String
|
||||
{
|
||||
trace(bParam + "," + aParam);
|
||||
return first + second + aParam + bParam;
|
||||
}
|
||||
trace(second);
|
||||
traceParam2(aParam);
|
||||
return first;
|
||||
};
|
||||
traceParameter("hello");
|
||||
}
|
||||
}
|
||||
}
|
||||
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInnerFunctions.as
vendored
Normal file
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInnerFunctions.as
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestInnerFunctions
|
||||
{
|
||||
public function run(a:String):*
|
||||
{
|
||||
var s:int = 0;
|
||||
var innerFunc:Function = function(b:String):*
|
||||
{
|
||||
trace(b);
|
||||
};
|
||||
var k:int = 5;
|
||||
if (k == 6)
|
||||
{
|
||||
s = 8;
|
||||
}
|
||||
innerFunc(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
33
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInnerIf.as
vendored
Normal file
33
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInnerIf.as
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestInnerIf
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
var b:* = 4;
|
||||
if (a == 5)
|
||||
{
|
||||
if (b == 6)
|
||||
{
|
||||
trace("b==6");
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("b!=6");
|
||||
}
|
||||
}
|
||||
else if (b == 7)
|
||||
{
|
||||
trace("b==7");
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("b!=7");
|
||||
}
|
||||
|
||||
trace("end");
|
||||
}
|
||||
}
|
||||
}
|
||||
30
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInnerTry.as
vendored
Normal file
30
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestInnerTry.as
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestInnerTry
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
trace("try body 1");
|
||||
}
|
||||
catch (e:DefinitionError)
|
||||
{
|
||||
trace("catched DefinitionError");
|
||||
}
|
||||
trace("after try 1");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("catched Error");
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("finally block");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestLogicalComputing.as
vendored
Normal file
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestLogicalComputing.as
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestLogicalComputing
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var b:Boolean = false;
|
||||
var i:* = 5;
|
||||
var j:* = 7;
|
||||
if (i > j)
|
||||
{
|
||||
j = 9;
|
||||
b = true;
|
||||
}
|
||||
b = (i == 0 || i == 1) && j == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestManualConvert.as
vendored
Normal file
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestManualConvert.as
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestManualConvert
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
trace("String(this).length");
|
||||
trace(String(this).length);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestMissingDefault.as
vendored
Normal file
22
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestMissingDefault.as
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestMissingDefault
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var jj:int = 1;
|
||||
switch (jj)
|
||||
{
|
||||
case 1:
|
||||
jj = 1;
|
||||
break;
|
||||
case 2:
|
||||
jj = 2;
|
||||
break;
|
||||
default:
|
||||
jj = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestMultipleCondition.as
vendored
Normal file
21
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestMultipleCondition.as
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestMultipleCondition
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
var b:* = 8;
|
||||
var c:* = 9;
|
||||
if ((a <= 4 || b <= 8) && c == 7)
|
||||
{
|
||||
trace("onTrue");
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("onFalse");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestNamedAnonFunctions.as
vendored
Normal file
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestNamedAnonFunctions.as
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package tests
|
||||
{
|
||||
public class TestNamedAnonFunctions
|
||||
{
|
||||
public function run() : *
|
||||
{
|
||||
var test:* = new function testFunc(param1:*, param2:int, param3:Array):Boolean
|
||||
{
|
||||
return (param1 as TestClass2).attrib1 == 5;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass2
|
||||
{
|
||||
public var attrib1:int;
|
||||
}
|
||||
|
||||
32
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestNames.as
vendored
Normal file
32
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestNames.as
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
package tests
|
||||
{
|
||||
import tests_other.myInternal;
|
||||
|
||||
public class TestNames
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var ns:* = this.getNamespace();
|
||||
var name:* = this.getName();
|
||||
var a:* = ns::unnamespacedFunc();
|
||||
var b:* = ns::[name];
|
||||
trace(b.c);
|
||||
var c:* = myInternal::neco;
|
||||
}
|
||||
|
||||
public function getNamespace():Namespace
|
||||
{
|
||||
return myInternal;
|
||||
}
|
||||
|
||||
public function getName():String
|
||||
{
|
||||
return "unnamespacedFunc";
|
||||
}
|
||||
|
||||
myInternal function namespacedFunc() : void
|
||||
{
|
||||
trace("hello");
|
||||
}
|
||||
}
|
||||
}
|
||||
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestOptionalParameters.as
vendored
Normal file
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestOptionalParameters.as
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package tests
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class TestOptionalParameters
|
||||
{
|
||||
public function run(p1:Event=null, p2:Number=1, p3:Number=-1, p4:Number=-1.1, p5:Number=-1.1, p6:String="a") : *
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
11
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestParamNames.as
vendored
Normal file
11
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestParamNames.as
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestParamNames
|
||||
{
|
||||
public function run(firstp:int, secondp:int, thirdp:int) : int
|
||||
{
|
||||
return firstp + secondp + thirdp;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestParamsCount.as
vendored
Normal file
11
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestParamsCount.as
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestParamsCount
|
||||
{
|
||||
public function run(firstp:int, secondp:int, thirdp:int):int
|
||||
{
|
||||
return firstp;
|
||||
}
|
||||
}
|
||||
}
|
||||
22
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestPrecedence.as
vendored
Normal file
22
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestPrecedence.as
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestPrecedence
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 0;
|
||||
a = (5 + 6) * 7;
|
||||
a = 5 * (2 + 3);
|
||||
a = 5 + 6 * 7;
|
||||
a = 5 * 2 + 2;
|
||||
a = 5 * (25 % 3);
|
||||
a = 5 % (24 * 307);
|
||||
a = 1 / (2 / 3);
|
||||
a = 1 / (2 * 3);
|
||||
a = 1 * 2 * 3;
|
||||
a = 1 * 2 / 3;
|
||||
trace("a=" + a);
|
||||
}
|
||||
}
|
||||
}
|
||||
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestPrecedenceX.as
vendored
Normal file
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestPrecedenceX.as
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestPrecedenceX
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
var b:* = 2;
|
||||
var c:* = 3;
|
||||
var d:* = a << (b >>> c);
|
||||
var e:* = a << b >>> c;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestProperty.as
vendored
Normal file
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestProperty.as
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestProperty
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var d:* = new TestClass1();
|
||||
var k:* = 7 + 8;
|
||||
if (k == 15)
|
||||
{
|
||||
d.method(d.attrib * 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass1
|
||||
{
|
||||
public var attrib:int = 5;
|
||||
|
||||
public function method(i:int):int
|
||||
{
|
||||
trace("method");
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
14
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestRegExp.as
vendored
Normal file
14
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestRegExp.as
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestRegExp
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a1:* = /[a-z\r\n0-9\\]+/i;
|
||||
var a2:* = /[a-z\r\n0-9\\]+/i;
|
||||
var b1:* = /[0-9AB]+/;
|
||||
var b2:* = /[0-9AB]+/;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestRest.as
vendored
Normal file
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestRest.as
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestRest
|
||||
{
|
||||
public function run(firstp:int, ... restval):int
|
||||
{
|
||||
trace("firstRest:" + restval[0]);
|
||||
return firstp;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestStringConcat.as
vendored
Normal file
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestStringConcat.as
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestStringConcat
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var k:int = 8;
|
||||
this.traceIt("hello" + 5 * 6);
|
||||
this.traceIt("hello" + (k - 1));
|
||||
this.traceIt("hello" + 5 + 6);
|
||||
}
|
||||
|
||||
private function traceIt(s:String) : void
|
||||
{
|
||||
trace(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestStrings.as
vendored
Normal file
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestStrings.as
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestStrings
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
trace("hello");
|
||||
trace("quotes:\"hello!\"");
|
||||
trace("backslash: \\ ");
|
||||
trace("single quotes: \'hello!\'");
|
||||
trace("new line \r\n hello!");
|
||||
}
|
||||
}
|
||||
}
|
||||
24
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestSwitch.as
vendored
Normal file
24
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestSwitch.as
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestSwitch
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
switch (a)
|
||||
{
|
||||
case 57 * a:
|
||||
trace("fiftyseven multiply a");
|
||||
break;
|
||||
case 13:
|
||||
trace("thirteen");
|
||||
case 14:
|
||||
trace("fourteen");
|
||||
break;
|
||||
case 89:
|
||||
trace("eightynine");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestSwitchDefault.as
vendored
Normal file
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestSwitchDefault.as
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestSwitchDefault
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
switch (a)
|
||||
{
|
||||
case 57 * a:
|
||||
trace("fiftyseven multiply a");
|
||||
break;
|
||||
case 13:
|
||||
trace("thirteen");
|
||||
case 14:
|
||||
trace("fourteen");
|
||||
break;
|
||||
case 89:
|
||||
trace("eightynine");
|
||||
break;
|
||||
default:
|
||||
trace("default clause");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestTernarOperator.as
vendored
Normal file
16
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestTernarOperator.as
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestTernarOperator
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
var b:* = 4;
|
||||
var c:* = 4;
|
||||
var d:* = 78;
|
||||
var e:* = a == b ? c == d ? 1 : 7 : 3;
|
||||
trace("e=" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestTry.as
vendored
Normal file
30
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestTry.as
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestTry
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var i:int = 0;
|
||||
i = 7;
|
||||
try
|
||||
{
|
||||
trace("try body");
|
||||
}
|
||||
catch (e:DefinitionError)
|
||||
{
|
||||
trace("catched DefinitionError");
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
trace("Error message:" + e.message);
|
||||
trace("Stacktrace:" + e.getStackTrace());
|
||||
}
|
||||
finally
|
||||
{
|
||||
trace("Finally part");
|
||||
}
|
||||
trace("end");
|
||||
}
|
||||
}
|
||||
}
|
||||
37
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestTryReturn.as
vendored
Normal file
37
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestTryReturn.as
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestTryReturn
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var i:int = 0;
|
||||
var b:Boolean = false;
|
||||
try
|
||||
{
|
||||
i = 0;
|
||||
b = true;
|
||||
if (i > 0)
|
||||
{
|
||||
while (this.testDoWhile2())
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
return 2;
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
public function testDoWhile2() :Boolean{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestVector.as
vendored
Normal file
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestVector.as
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestVector
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var v:Vector.<String> = new Vector.<String>();
|
||||
v.push("hello");
|
||||
v[0] = "hi";
|
||||
v[5 * 8 - 39] = "hi2";
|
||||
trace(v[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestVector2.as
vendored
Normal file
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestVector2.as
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestVector2
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:Vector.<Vector.<int>> = new Vector.<Vector.<int>>();
|
||||
var b:Vector.<int> = new <int>[10, 20, 30];
|
||||
}
|
||||
}
|
||||
}
|
||||
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestWhileAnd.as
vendored
Normal file
19
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestWhileAnd.as
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestWhileAnd
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:int = 5;
|
||||
var b:int = 10;
|
||||
while (a < 10 && b > 1)
|
||||
{
|
||||
a++;
|
||||
b--;
|
||||
}
|
||||
a = 7;
|
||||
b = 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestWhileContinue.as
vendored
Normal file
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestWhileContinue.as
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestWhileContinue
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
while (true)
|
||||
{
|
||||
if (a == 9)
|
||||
{
|
||||
if (a == 8)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (a == 9)
|
||||
{
|
||||
break;
|
||||
}
|
||||
trace("hello 1");
|
||||
}
|
||||
trace("hello2");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
29
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestWhileTry.as
vendored
Normal file
29
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestWhileTry.as
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package tests
|
||||
{
|
||||
import flash.errors.EOFError;
|
||||
|
||||
public class TestWhileTry
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
trace("a");
|
||||
}
|
||||
}
|
||||
catch (e:EOFError)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
32
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestWhileTry2.as
vendored
Normal file
32
libsrc/ffdec_lib/testdata/flashdevelop/src/tests/TestWhileTry2.as
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
package tests
|
||||
{
|
||||
import flash.errors.EOFError;
|
||||
|
||||
public class TestWhileTry2
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var j:* = undefined;
|
||||
for (var i:* = 0; i < 100; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (j = 0; j < 20; j++)
|
||||
{
|
||||
trace("a");
|
||||
}
|
||||
}
|
||||
catch (e:EOFError)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
catch (e:Error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
trace("after_try");
|
||||
}
|
||||
trace("end");
|
||||
}
|
||||
}
|
||||
}
|
||||
17
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/SetupMyPackage1.as
vendored
Normal file
17
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/SetupMyPackage1.as
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package tests_classes.mypackage1
|
||||
{
|
||||
public class SetupMyPackage1
|
||||
{
|
||||
myNamespace;
|
||||
TestClass;
|
||||
TestClass2;
|
||||
TestInterface;
|
||||
|
||||
public function SetupMyPackage1()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/TestClass.as
vendored
Normal file
27
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/TestClass.as
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package tests_classes.mypackage1
|
||||
{
|
||||
import tests_classes.mypackage2.TestClass;
|
||||
|
||||
public class TestClass implements tests_classes.mypackage1.TestInterface
|
||||
{
|
||||
public function testCall() : String
|
||||
{
|
||||
trace("pkg1hello");
|
||||
return "pkg1hello";
|
||||
}
|
||||
|
||||
public function testMethod1() : void {
|
||||
var a : tests_classes.mypackage1.TestInterface = this;
|
||||
a.testMethod1();
|
||||
var b : tests_classes.mypackage2.TestInterface = this;
|
||||
b = new tests_classes.mypackage2.TestClass();
|
||||
}
|
||||
|
||||
public function testMethod2() : void {
|
||||
var a : tests_classes.mypackage1.TestInterface = this;
|
||||
a.testMethod1();
|
||||
var b : tests_classes.mypackage2.TestInterface = this;
|
||||
b = new tests_classes.mypackage2.TestClass();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/TestClass2.as
vendored
Normal file
36
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/TestClass2.as
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
package tests_classes.mypackage1
|
||||
{
|
||||
import tests_classes.mypackage2.TestClass;
|
||||
import tests_classes.mypackage3.TestClass;
|
||||
|
||||
public class TestClass2
|
||||
{
|
||||
public function testCall() : String
|
||||
{
|
||||
var a : tests_classes.mypackage1.TestClass;
|
||||
a = new tests_classes.mypackage1.TestClass();
|
||||
var b : tests_classes.mypackage2.TestClass;
|
||||
b = new tests_classes.mypackage2.TestClass();
|
||||
var c : tests_classes.mypackage3.TestClass;
|
||||
c = new tests_classes.mypackage3.TestClass();
|
||||
var res:String = a.testCall() + b.testCall() + c.testCall() + testCall2() + myNamespace::testCall3();
|
||||
trace(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
myNamespace function testCall2() : String
|
||||
{
|
||||
return "1";
|
||||
}
|
||||
|
||||
myNamespace function testCall3() : String
|
||||
{
|
||||
return myNamespace::testCall2();
|
||||
}
|
||||
|
||||
public function testCall2() : String
|
||||
{
|
||||
return "2";
|
||||
}
|
||||
}
|
||||
}
|
||||
9
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/TestInterface.as
vendored
Normal file
9
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/TestInterface.as
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
package tests_classes.mypackage1
|
||||
{
|
||||
import tests_classes.mypackage2.TestInterface;
|
||||
|
||||
public interface TestInterface extends tests_classes.mypackage2.TestInterface
|
||||
{
|
||||
function testMethod1() : void;
|
||||
}
|
||||
}
|
||||
4
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/myNamespace.as
vendored
Normal file
4
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage1/myNamespace.as
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
package tests_classes.mypackage1
|
||||
{
|
||||
public namespace myNamespace = "https://www.free-decompiler.com/flash/test/namespace";
|
||||
}
|
||||
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage2/SetupMyPackage2.as
vendored
Normal file
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage2/SetupMyPackage2.as
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package tests_classes.mypackage2
|
||||
{
|
||||
public class SetupMyPackage2
|
||||
{
|
||||
TestClass;
|
||||
TestInterface;
|
||||
|
||||
public function SetupMyPackage2()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage2/TestClass.as
vendored
Normal file
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage2/TestClass.as
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package tests_classes.mypackage2
|
||||
{
|
||||
|
||||
public class TestClass implements TestInterface
|
||||
{
|
||||
public function testCall() : String
|
||||
{
|
||||
trace("pkg2hello");
|
||||
return "pkg2hello";
|
||||
}
|
||||
|
||||
public function testMethod2() : void {
|
||||
}
|
||||
}
|
||||
}
|
||||
7
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage2/TestInterface.as
vendored
Normal file
7
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage2/TestInterface.as
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
package tests_classes.mypackage2
|
||||
{
|
||||
public interface TestInterface
|
||||
{
|
||||
function testMethod2() : void;
|
||||
}
|
||||
}
|
||||
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage3/SetupMyPackage3.as
vendored
Normal file
15
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage3/SetupMyPackage3.as
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package tests_classes.mypackage3
|
||||
{
|
||||
public class SetupMyPackage3
|
||||
{
|
||||
TestClass;
|
||||
TestInterface;
|
||||
|
||||
public function SetupMyPackage3()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage3/TestClass.as
vendored
Normal file
12
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage3/TestClass.as
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package tests_classes.mypackage3
|
||||
{
|
||||
|
||||
public class TestClass
|
||||
{
|
||||
public function testCall() : String
|
||||
{
|
||||
trace("pkg3hello");
|
||||
return "pkg3hello";
|
||||
}
|
||||
}
|
||||
}
|
||||
7
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage3/TestInterface.as
vendored
Normal file
7
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_classes/mypackage3/TestInterface.as
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
package tests_classes.mypackage3
|
||||
{
|
||||
public interface TestInterface
|
||||
{
|
||||
function testMethod3() : void;
|
||||
}
|
||||
}
|
||||
4
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_other/myInternal.as
vendored
Normal file
4
libsrc/ffdec_lib/testdata/flashdevelop/src/tests_other/myInternal.as
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
package tests_other
|
||||
{
|
||||
public namespace myInternal = "http://www.adobe.com/2006/actionscript/examples";
|
||||
}
|
||||
Reference in New Issue
Block a user