diff --git a/core/tests/swfs/avm2/astypelate/Test.as b/core/tests/swfs/avm2/astypelate/Test.as new file mode 100644 index 000000000..caf7c25c2 --- /dev/null +++ b/core/tests/swfs/avm2/astypelate/Test.as @@ -0,0 +1,100 @@ +package { + public class Test { + } +} + +interface ITest2 { + function method(); + function method2(); +} + +class Test2 implements ITest2 { + function Test2() { + } + + public function method() { + trace("Instance method"); + } + + public function method2() { + trace("Instance method 2"); + } +} + +interface ITest3 extends ITest2 { + function method3() +} + +class Test3 extends Test2 implements ITest3 { + function Test3() { + } + + public override function method() { + trace("Child instance method pre-super"); + super.method(); + trace("Child instance method post-super"); + } + + public function method3() { + trace("Child instance method3 pre-super"); + super.method(); + trace("Child instance method3 post-super"); + } +} + +class Test4 extends Test3 { + function Test4() { + } + + public override function method2() { + trace("Grandchild instance method2 pre-super"); + super.method2(); + trace("Grandchild instance method2 post-super"); + } + + public override function method3() { + trace("Grandchild instance method3 pre-super"); + super.method3(); + trace("Grandchild instance method3 post-super"); + } +} + +var x = new Test3(); + +trace("//x as Object"); +trace(x as Object); + +trace("//x as Test2"); +trace(x as Test2); + +trace("//x as ITest2"); +trace(x as ITest2); + +trace("//x as Test3"); +trace(x as Test3); + +trace("//x as ITest3"); +trace(x as ITest3); + +trace("//x as Test4"); +trace(x as Test4); + +var y = new Test4(); + +trace("//y as Object"); +trace(y as Object); + +trace("//y as Test2"); +trace(y as Test2); + +trace("//y as ITest2"); +trace(y as ITest2); + +trace("//y as Test3"); +trace(y as Test3); + +trace("//y as ITest3"); +trace(y as ITest3); + +trace("//y as Test4"); +trace(y as Test4); \ No newline at end of file diff --git a/core/tests/swfs/avm2/astypelate/output.txt b/core/tests/swfs/avm2/astypelate/output.txt new file mode 100644 index 000000000..8d665b868 --- /dev/null +++ b/core/tests/swfs/avm2/astypelate/output.txt @@ -0,0 +1,24 @@ +//x as Object +[object Test3] +//x as Test2 +[object Test3] +//x as ITest2 +[object Test3] +//x as Test3 +[object Test3] +//x as ITest3 +[object Test3] +//x as Test4 +null +//y as Object +[object Test4] +//y as Test2 +[object Test4] +//y as ITest2 +[object Test4] +//y as Test3 +[object Test4] +//y as ITest3 +[object Test4] +//y as Test4 +[object Test4] diff --git a/core/tests/swfs/avm2/astypelate/test.fla b/core/tests/swfs/avm2/astypelate/test.fla new file mode 100644 index 000000000..c6c90b195 Binary files /dev/null and b/core/tests/swfs/avm2/astypelate/test.fla differ diff --git a/core/tests/swfs/avm2/astypelate/test.swf b/core/tests/swfs/avm2/astypelate/test.swf new file mode 100644 index 000000000..e91fba619 Binary files /dev/null and b/core/tests/swfs/avm2/astypelate/test.swf differ