In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Debugging stack overflows

Does anybody know how I can find out which function started the infinite recursion?

The stack trace cuts off and doesn't show which function initially called overflow()
Get Adobe Flash player
by yonatan 24 Mar 2011
/**
 * Copyright yonatan ( http://wonderfl.net/user/yonatan )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/5hjQ
 */

// Does anybody know how I can find out which function 
// started the infinite recursion?
//
// The stack trace cuts off and doesn't show which 
// function initially called overflow()

package {
    import com.bit101.components.TextArea;
    public class FlashTest extends TextArea {
        public function FlashTest() {
            width=height=465;
            try {
                test();
            } catch(e:Error) {
                text = e.getStackTrace();
            }
        }
        
        private function test():void {
            overflow();
        }
        
        private function overflow():void {
            overflow();
        }
    }
}