Coding problem in ActionScript
The following code generates a VerifyError when getInstance is called. VerifyError: Error #1030: Stack depth is unbalanced. 0 != 1. at SingletonTest$iinit() public class SingletonTest { private static var s_singleton:SingletonTest = null; public static function getInstance():SingletonTest { if (s_singleton == null) s_singleton = new SingletonTest(); //Fails at this line. return s_singleton; } public function SingletonTest() { super; try { } catch (e:Error) { } } } Can you guess why? The reason is the super call in the constructor which is missing the () ! Why wouldn't the compiler throw a error or ignore the statement?
9:32 AM
|
Labels:
Flex 3 Issues
|
This entry was posted on 9:32 AM
and is filed under
Flex 3 Issues
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
0 comments:
Post a Comment