SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Third Stone From The Sun
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error.prototype.stack, other browsers

    Does anyone know of a hacked up JS patch for Error.prototype.stack or a getStack functionality for IE and Safari?

    Does Opera have Error.prototype.stack?

    Maybe something like:
    Code:
    Error.getStack = function getStack( error ) {
      if( error.stack ) return error.stack;
     
     // look up the call chain...
    var fakeStack = [ ];
    for( var caller = arguments.callee.caller; 
            caller != null; caller = callee.caller ) {
       fakeStack.push( caller );
    }
    return fakeStack;
    };
    This is just typed in. I need tested library code that I can rely on.

    Thank you,

    Garrett
    Last edited by DHTML Kitchen; May 1, 2007 at 09:13. Reason: missing [/code]
    My outdated site is down for a while now.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •