Created
July 11, 2016 09:20
-
-
Save pipeno/03310d3d3cae61460ac6c590c4f355ed to your computer and use it in GitHub Desktop.
StackTrace tests as3
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
package | |
{ | |
import flash.display.Sprite; | |
import flash.external.ExternalInterface; | |
public class StackTrace extends Sprite | |
{ | |
public function StackTrace() | |
{ | |
ExternalInterface.call('console.log', 'StackTrace 1: ' + getStackTrace1()); | |
ExternalInterface.call('console.log', 'StackTrace 2: ' + getStackTrace2()); | |
} | |
public function getStackTrace1():String { | |
return (new Error()).getStackTrace(); | |
} | |
public function getStackTrace2():String { | |
try { | |
throw new Error('StackTrace'); | |
} catch (e:Error) { | |
return e.getStackTrace(); | |
} | |
return null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment