mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-07 12:08:15 +00:00
Separated increment/decrement tests.
This commit is contained in:
Binary file not shown.
Binary file not shown.
16
libsrc/ffdec_lib/testdata/as3_new/src/Main.as
vendored
16
libsrc/ffdec_lib/testdata/as3_new/src/Main.as
vendored
@@ -80,8 +80,20 @@ package
|
||||
TestImplicitCoerce;
|
||||
TestImportedConst;
|
||||
TestImportedVar;
|
||||
TestInc2;
|
||||
TestIncDec;
|
||||
TestIncDec1;
|
||||
TestIncDec2;
|
||||
TestIncDec3;
|
||||
TestIncDec4;
|
||||
TestIncDec5;
|
||||
TestIncDec6;
|
||||
TestIncDec7;
|
||||
TestIncDec8;
|
||||
TestIncDec9;
|
||||
TestIncDec10;
|
||||
TestIncDec11;
|
||||
TestIncDec12;
|
||||
TestIncDec13;
|
||||
TestIncDec14;
|
||||
TestInlineFunctions;
|
||||
TestInlineFunctions2;
|
||||
TestInnerFunctions;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestInc2
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = [1];
|
||||
var d:* = a[this.getInt()]++;
|
||||
var e:* = ++a[this.getInt()];
|
||||
|
||||
a[this.getInt()]++;
|
||||
++a[this.getInt()];
|
||||
|
||||
var b:* = 1;
|
||||
b++;
|
||||
var c:* = 1;
|
||||
b = c++;
|
||||
}
|
||||
|
||||
private function getInt():int
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec
|
||||
{
|
||||
|
||||
private var attrx:int = 0;
|
||||
|
||||
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;
|
||||
trace("attr++");
|
||||
trace(attrx++);
|
||||
attrx++;
|
||||
trace("attr--");
|
||||
trace(attrx--);
|
||||
attrx--;
|
||||
trace("++attr");
|
||||
trace(++attrx);
|
||||
++attrx;
|
||||
trace("--attr");
|
||||
trace(--attrx);
|
||||
--attrx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass1
|
||||
{
|
||||
public var attrib:int = 5;
|
||||
}
|
||||
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec1.as
vendored
Normal file
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec1.as
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec1
|
||||
{
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
|
||||
trace("++a with result");
|
||||
trace(++a);
|
||||
|
||||
trace("--a with result");
|
||||
trace(--a);
|
||||
|
||||
trace("++a no result");
|
||||
++a;
|
||||
|
||||
trace("--a no result");
|
||||
--a;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec10.as
vendored
Normal file
23
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec10.as
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec10
|
||||
{
|
||||
private var attrib:int = 0;
|
||||
|
||||
public function run():*
|
||||
{
|
||||
trace("attrib++ with result");
|
||||
trace(attrib++);
|
||||
|
||||
trace("attrib-- with result");
|
||||
trace(attrib--);
|
||||
|
||||
trace("attrib++ no result");
|
||||
attrib++;
|
||||
|
||||
trace("attrib-- no result");
|
||||
attrib--;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec11.as
vendored
Normal file
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec11.as
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec11
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var f:Function = function():void {};
|
||||
var slot:int = 0;
|
||||
|
||||
trace("++slot with result");
|
||||
trace(++slot);
|
||||
|
||||
trace("--slot with result");
|
||||
trace(--slot);
|
||||
|
||||
trace("++slot no result");
|
||||
++slot;
|
||||
|
||||
trace("--slot no result");
|
||||
--slot;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec12.as
vendored
Normal file
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec12.as
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec12
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var f:Function = function():void {};
|
||||
var slot:int = 0;
|
||||
|
||||
trace("slot++ with result");
|
||||
trace(slot++);
|
||||
|
||||
trace("slot-- with result");
|
||||
trace(slot--);
|
||||
|
||||
trace("slot++ no result");
|
||||
slot++;
|
||||
|
||||
trace("slot-- no result");
|
||||
slot--;
|
||||
}
|
||||
}
|
||||
}
|
||||
28
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec13.as
vendored
Normal file
28
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec13.as
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec13
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = [1,2,3,4,5];
|
||||
|
||||
trace("++a[this.f()] with result");
|
||||
trace(++a[this.f()]);
|
||||
|
||||
trace("--a[this.f()] with result");
|
||||
trace(--a[this.f()]);
|
||||
|
||||
trace("++a[this.f()] no result");
|
||||
++a[this.f()];
|
||||
|
||||
trace("--a[this.f()] no result");
|
||||
--a[this.f()];
|
||||
}
|
||||
|
||||
private function f():int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
28
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec14.as
vendored
Normal file
28
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec14.as
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec14
|
||||
{
|
||||
public function run():*
|
||||
{
|
||||
var a:* = [1,2,3,4,5];
|
||||
|
||||
trace("a[this.f()]++ with result");
|
||||
trace(a[this.f()]++);
|
||||
|
||||
trace("a[this.f()]-- with result");
|
||||
trace(a[this.f()]--);
|
||||
|
||||
trace("a[this.f()]++ no result");
|
||||
a[this.f()]++;
|
||||
|
||||
trace("a[this.f()]-- no result");
|
||||
a[this.f()]--;
|
||||
}
|
||||
|
||||
private function f():int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec2.as
vendored
Normal file
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec2.as
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec2
|
||||
{
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var a:* = 5;
|
||||
|
||||
trace("a++ with result");
|
||||
trace(a++);
|
||||
|
||||
trace("a-- with result");
|
||||
trace(a--);
|
||||
|
||||
trace("a++ no result");
|
||||
a++;
|
||||
|
||||
trace("a-- no result");
|
||||
a--;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec3.as
vendored
Normal file
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec3.as
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec3
|
||||
{
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var a:* = [1, 2, 3, 4, 5];
|
||||
|
||||
trace("++a[2] with result");
|
||||
trace(++a[2]);
|
||||
|
||||
trace("--a[2] with result");
|
||||
trace(--a[2]);
|
||||
|
||||
trace("++a[2] no result");
|
||||
++a[2];
|
||||
|
||||
trace("--a[2] no result");
|
||||
--a[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec4.as
vendored
Normal file
24
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec4.as
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec4
|
||||
{
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var a:* = [1, 2, 3, 4, 5];
|
||||
|
||||
trace("a[2]++ with result");
|
||||
trace(a[2]++);
|
||||
|
||||
trace("a[2]-- with result");
|
||||
trace(a[2]--);
|
||||
|
||||
trace("a[2]++ no result");
|
||||
a[2]++;
|
||||
|
||||
trace("a[2]-- no result");
|
||||
a[2]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec5.as
vendored
Normal file
29
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec5.as
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec5
|
||||
{
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var a:* = new TestClass1();
|
||||
|
||||
trace("++a.attrib with result");
|
||||
trace(++a.attrib);
|
||||
|
||||
trace("--a.attrib with result");
|
||||
trace(--a.attrib);
|
||||
|
||||
trace("++a.attrib no result");
|
||||
++a.attrib;
|
||||
|
||||
trace("--a.attrib no result");
|
||||
--a.attrib;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass1
|
||||
{
|
||||
public var attrib:int = 5;
|
||||
}
|
||||
29
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec6.as
vendored
Normal file
29
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec6.as
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec6
|
||||
{
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var a:* = new TestClass1();
|
||||
|
||||
trace("a.attrib++ with result");
|
||||
trace(a.attrib++);
|
||||
|
||||
trace("a.attrib-- with result");
|
||||
trace(a.attrib--);
|
||||
|
||||
trace("a.attrib++ no result");
|
||||
a.attrib++;
|
||||
|
||||
trace("a.attrib-- no result");
|
||||
a.attrib--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass1
|
||||
{
|
||||
public var attrib:int = 5;
|
||||
}
|
||||
19
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec7.as
vendored
Normal file
19
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec7.as
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec7
|
||||
{
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var a:* = [1,2,3,4,5];
|
||||
var index:int = 0;
|
||||
|
||||
trace("a[++index]");
|
||||
trace(a[++index]);
|
||||
|
||||
trace("a[--index]");
|
||||
trace(a[--index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec8.as
vendored
Normal file
20
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec8.as
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec8
|
||||
{
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var a:* = [1,2,3,4,5];
|
||||
var index:int = 0;
|
||||
|
||||
trace("a[index++]");
|
||||
trace(a[index++]);
|
||||
|
||||
trace("a[index--]");
|
||||
trace(a[index--]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
23
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec9.as
vendored
Normal file
23
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestIncDec9.as
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestIncDec9
|
||||
{
|
||||
private var attrib:int = 0;
|
||||
|
||||
public function run():*
|
||||
{
|
||||
trace("++attrib with result");
|
||||
trace(++attrib);
|
||||
|
||||
trace("--attrib with result");
|
||||
trace(--attrib);
|
||||
|
||||
trace("++attrib no result");
|
||||
++attrib;
|
||||
|
||||
trace("--attrib no result");
|
||||
--attrib;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ package tests
|
||||
{
|
||||
trace("A");
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
for (var i:int = 0; i < 10; i++)
|
||||
{
|
||||
if (a)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user