mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-08-02 15:42:36 +00:00
Fixed: #2335 AS3 direct editation - Type coercion of && and || operators
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -17,6 +17,7 @@ package
|
||||
public class Main extends Sprite
|
||||
{
|
||||
TestActivationArguments;
|
||||
TestAndOrCoercion;
|
||||
TestArguments;
|
||||
TestBitwiseOperands;
|
||||
TestCallCall;
|
||||
|
||||
41
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestAndOrCoercion.as
vendored
Normal file
41
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestAndOrCoercion.as
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
package tests
|
||||
{
|
||||
import tests_classes.mypackage1.TestClass;
|
||||
import tests_classes.mypackage1.TestInterface;
|
||||
|
||||
/*
|
||||
* This is more like a direct editation test than decompilation.
|
||||
* The compiler should add coercion around both sides of AND and OR operators,
|
||||
* if there is specific type required
|
||||
*/
|
||||
public class TestAndOrCoercion
|
||||
{
|
||||
private var ti:TestInterface;
|
||||
private var tc:TestClass;
|
||||
private var i:int = 5;
|
||||
private var j:int = 6;
|
||||
private var tx:TestInterface = ti || tc;
|
||||
|
||||
public function run():TestInterface
|
||||
{
|
||||
var x:TestInterface = ti || ((ti = new TestClass()) && (ti = new TestClass()));
|
||||
var y:TestInterface = ti && (ti = new TestClass());
|
||||
var z:TestClass = tc || (tc = new TestClass());
|
||||
|
||||
this.ti = ti && (ti = new TestClass());
|
||||
|
||||
var a = ti && (ti = new TestClass());
|
||||
|
||||
var b:int = 1 + (i || j); //no coercion
|
||||
|
||||
test(ti && (ti = new TestClass()));
|
||||
|
||||
return ti && (ti = new TestClass());
|
||||
}
|
||||
|
||||
public function test(p:TestInterface)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user