Simn / haxe

6 stars 0 forks source link

Implement haxe.CallStack for Python #30

Closed nadako closed 10 years ago

nadako commented 10 years ago

Added very basic implementation. Here's some code to play with:

import haxe.CallStack;

class Main
{
    static function main()
    {
        f();
    }

    static function f()
    {
        var m = new Main();
        function z() m.a();
        z();
    }

    function new() {}

    function a()
    {
        trace(CallStack.toString(CallStack.callStack()));

        try
        {
            lol();
        }
        catch (e:Dynamic)
        {
            haha();
        }
    }

    function lol() throw "fu";
    function haha() trace(CallStack.toString(CallStack.exceptionStack()));
}
Simn commented 10 years ago

Nice, thanks!

frabbit commented 10 years ago

awesome, thanks!