mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-01 06:41:26 +00:00
Fixed #1937 AS3 - declarations vs null
This commit is contained in:
Binary file not shown.
Binary file not shown.
277
libsrc/ffdec_lib/testdata/as3_new/src/Main.as
vendored
277
libsrc/ffdec_lib/testdata/as3_new/src/Main.as
vendored
@@ -1,152 +1,153 @@
|
||||
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;
|
||||
import tests_classes.*;
|
||||
import tests_edit.*;
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class Main extends Sprite
|
||||
{
|
||||
TestActivationArguments;
|
||||
TestArguments;
|
||||
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;
|
||||
import tests_classes.*;
|
||||
import tests_edit.*;
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class Main extends Sprite
|
||||
{
|
||||
TestActivationArguments;
|
||||
TestArguments;
|
||||
TestCallCall;
|
||||
TestCallLocal;
|
||||
TestCatchFinally;
|
||||
TestChain2;
|
||||
TestChainedAssignments;
|
||||
TestCallLocal;
|
||||
TestCatchFinally;
|
||||
TestChain2;
|
||||
TestChainedAssignments;
|
||||
TestCollidingTry;
|
||||
TestComplexExpressions;
|
||||
TestContinueLevels;
|
||||
TestConvert;
|
||||
TestComma;
|
||||
TestCompoundAssignments;
|
||||
TestDecl2;
|
||||
TestDeclarations;
|
||||
TestDeobfuscation;
|
||||
TestDefaultNotLastGrouped;
|
||||
TestDotParent;
|
||||
TestDoWhile;
|
||||
TestDoWhile2;
|
||||
TestDoWhile3;
|
||||
TestDoWhile4;
|
||||
TestExpressions;
|
||||
TestFinallyZeroJump;
|
||||
TestFor;
|
||||
TestForAnd;
|
||||
TestForBreak;
|
||||
TestForContinue;
|
||||
TestForEach;
|
||||
TestForEachObjectArray;
|
||||
TestForEachObjectAttribute;
|
||||
TestForEachReturn;
|
||||
TestForEachReturn2;
|
||||
TestForGoto;
|
||||
TestForIn;
|
||||
TestForInIf;
|
||||
TestForInReturn;
|
||||
TestForInSwitch;
|
||||
TestForXml;
|
||||
TestGotos;
|
||||
TestGotos2;
|
||||
TestGotos3;
|
||||
TestGotos4;
|
||||
TestGotos5;
|
||||
TestGotos6;
|
||||
TestGotos7;
|
||||
TestHello;
|
||||
TestIf;
|
||||
TestIfElse;
|
||||
TestIfFinally;
|
||||
TestIfInIf;
|
||||
TestIfTry;
|
||||
TestIgnoreAndOr;
|
||||
TestContinueLevels;
|
||||
TestConvert;
|
||||
TestComma;
|
||||
TestCompoundAssignments;
|
||||
TestDecl2;
|
||||
TestDeclarations;
|
||||
TestDeclarationInterface;
|
||||
TestDeobfuscation;
|
||||
TestDefaultNotLastGrouped;
|
||||
TestDotParent;
|
||||
TestDoWhile;
|
||||
TestDoWhile2;
|
||||
TestDoWhile3;
|
||||
TestDoWhile4;
|
||||
TestExpressions;
|
||||
TestFinallyZeroJump;
|
||||
TestFor;
|
||||
TestForAnd;
|
||||
TestForBreak;
|
||||
TestForContinue;
|
||||
TestForEach;
|
||||
TestForEachObjectArray;
|
||||
TestForEachObjectAttribute;
|
||||
TestForEachReturn;
|
||||
TestForEachReturn2;
|
||||
TestForGoto;
|
||||
TestForIn;
|
||||
TestForInIf;
|
||||
TestForInReturn;
|
||||
TestForInSwitch;
|
||||
TestForXml;
|
||||
TestGotos;
|
||||
TestGotos2;
|
||||
TestGotos3;
|
||||
TestGotos4;
|
||||
TestGotos5;
|
||||
TestGotos6;
|
||||
TestGotos7;
|
||||
TestHello;
|
||||
TestIf;
|
||||
TestIfElse;
|
||||
TestIfFinally;
|
||||
TestIfInIf;
|
||||
TestIfTry;
|
||||
TestIgnoreAndOr;
|
||||
TestImplicitCoerce;
|
||||
TestImportedVar;
|
||||
TestInc2;
|
||||
TestIncDec;
|
||||
TestInlineFunctions;
|
||||
TestInlineFunctions2;
|
||||
TestInnerFunctions;
|
||||
TestInnerFunctionScope;
|
||||
TestInnerIf;
|
||||
TestInnerTry;
|
||||
TestLogicalComputing;
|
||||
TestManualConvert;
|
||||
TestMissingDefault;
|
||||
TestMultipleCondition;
|
||||
TestNamedAnonFunctions;
|
||||
TestNames;
|
||||
TestNegate;
|
||||
TestNumberCall;
|
||||
TestOptionalParameters;
|
||||
TestParamNames;
|
||||
TestParamsCount;
|
||||
TestPrecedence;
|
||||
TestPrecedenceX;
|
||||
TestProperty;
|
||||
TestRegExp;
|
||||
TestRest;
|
||||
TestImportedVar;
|
||||
TestInc2;
|
||||
TestIncDec;
|
||||
TestInlineFunctions;
|
||||
TestInlineFunctions2;
|
||||
TestInnerFunctions;
|
||||
TestInnerFunctionScope;
|
||||
TestInnerIf;
|
||||
TestInnerTry;
|
||||
TestLogicalComputing;
|
||||
TestManualConvert;
|
||||
TestMissingDefault;
|
||||
TestMultipleCondition;
|
||||
TestNamedAnonFunctions;
|
||||
TestNames;
|
||||
TestNegate;
|
||||
TestNumberCall;
|
||||
TestOptionalParameters;
|
||||
TestParamNames;
|
||||
TestParamsCount;
|
||||
TestPrecedence;
|
||||
TestPrecedenceX;
|
||||
TestProperty;
|
||||
TestRegExp;
|
||||
TestRest;
|
||||
TestSlots;
|
||||
TestSlots2;
|
||||
TestStrictEquals;
|
||||
TestStringConcat;
|
||||
TestStrings;
|
||||
TestSwitch;
|
||||
TestSlots2;
|
||||
TestStrictEquals;
|
||||
TestStringConcat;
|
||||
TestStrings;
|
||||
TestSwitch;
|
||||
TestSwitchContinue;
|
||||
TestSwitchComma;
|
||||
TestSwitchDefault;
|
||||
TestSwitchIf;
|
||||
TestTernarOperator;
|
||||
TestTry;
|
||||
TestTryIf;
|
||||
TestTryReturn;
|
||||
TestTryReturn2;
|
||||
TestSwitchComma;
|
||||
TestSwitchDefault;
|
||||
TestSwitchIf;
|
||||
TestTernarOperator;
|
||||
TestTry;
|
||||
TestTryIf;
|
||||
TestTryReturn;
|
||||
TestTryReturn2;
|
||||
TestUndefined;
|
||||
TestUsagesTry;
|
||||
TestVector;
|
||||
TestVector2;
|
||||
TestWhileAnd;
|
||||
TestWhileBreak;
|
||||
TestUsagesTry;
|
||||
TestVector;
|
||||
TestVector2;
|
||||
TestWhileAnd;
|
||||
TestWhileBreak;
|
||||
TestWhileBreak2;
|
||||
TestWhileContinue;
|
||||
TestWhileTry;
|
||||
TestWhileTry2;
|
||||
TestXml;
|
||||
|
||||
SetupMyPackage1;
|
||||
SetupMyPackage2;
|
||||
SetupMyPackage3;
|
||||
|
||||
TestThisOutsideClass;
|
||||
TestImports;
|
||||
TestInitializer;
|
||||
TestRegexpHilight;
|
||||
|
||||
TestPropertyCoerce;
|
||||
TestUnaryMinus;
|
||||
TestWhileContinue;
|
||||
TestWhileTry;
|
||||
TestWhileTry2;
|
||||
TestXml;
|
||||
|
||||
SetupMyPackage1;
|
||||
SetupMyPackage2;
|
||||
SetupMyPackage3;
|
||||
|
||||
TestThisOutsideClass;
|
||||
TestImports;
|
||||
TestInitializer;
|
||||
TestRegexpHilight;
|
||||
|
||||
TestPropertyCoerce;
|
||||
TestUnaryMinus;
|
||||
|
||||
TestModifiers;
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
34
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestDeclarationInterface.as
vendored
Normal file
34
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestDeclarationInterface.as
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestDeclarationInterface
|
||||
{
|
||||
public function run(): MyIFace
|
||||
{
|
||||
var i:MyIFace = null;
|
||||
var n:int = 2;
|
||||
switch(n) {
|
||||
case 0:
|
||||
i = new MyClass();
|
||||
break;
|
||||
case 1:
|
||||
i = new MyClass2();
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface MyIFace {
|
||||
|
||||
}
|
||||
|
||||
class MyClass implements MyIFace {
|
||||
|
||||
}
|
||||
|
||||
class MyClass2 implements MyIFace {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user