-
-
Notifications
You must be signed in to change notification settings - Fork 816
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avm2: Add test for instantiating abstract classes
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// compiled with mxmlc | ||
|
||
import flash.display.*; | ||
import flash.text.engine.TextLine; | ||
import flash.system.Worker; | ||
|
||
package { | ||
import flash.display.MovieClip; | ||
public class Test extends MovieClip { | ||
public function Test() { | ||
var classes = [ | ||
Stage, | ||
DisplayObject, | ||
DisplayObjectContainer, | ||
InteractiveObject, | ||
LoaderInfo, | ||
TextLine, | ||
Class, | ||
Math, | ||
MorphShape, | ||
Worker, | ||
] | ||
for each(var t in classes) { | ||
trace(t); | ||
try { | ||
new t(); | ||
} catch(e) { | ||
trace(e.getStackTrace()); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[class Stage] | ||
ArgumentError: Error #2012: Stage$ class cannot be instantiated. | ||
at Test() | ||
[class DisplayObject] | ||
ArgumentError: Error #2012: DisplayObject$ class cannot be instantiated. | ||
at Test() | ||
[class DisplayObjectContainer] | ||
ArgumentError: Error #2012: DisplayObjectContainer$ class cannot be instantiated. | ||
at Test() | ||
[class InteractiveObject] | ||
ArgumentError: Error #2012: InteractiveObject$ class cannot be instantiated. | ||
at Test() | ||
[class LoaderInfo] | ||
ArgumentError: Error #2012: LoaderInfo$ class cannot be instantiated. | ||
at Test() | ||
[class TextLine] | ||
ArgumentError: Error #2012: TextLine$ class cannot be instantiated. | ||
at Test() | ||
[class Class] | ||
TypeError: Error #1115: Class$ is not a constructor. | ||
at Test() | ||
[class Math] | ||
TypeError: Error #1076: Math is not a constructor. | ||
at Test() | ||
[class MorphShape] | ||
ArgumentError: Error #2012: MorphShape$ class cannot be instantiated. | ||
at Test() | ||
[class Worker] | ||
ArgumentError: Error #2012: Worker$ class cannot be instantiated. | ||
at Test() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
num_frames = 1 |