How to increase number of Call Stack entries in Google Chrome Developer Tools (or Firefox)?

后端 未结 3 1393
野性不改
野性不改 2020-12-23 11:30

How to increase number of Call Stack entries in Google Chrome Developer Tools (or Firefox Firebug)? I am getting a Javascript error in a third party control\'s Javascript. A

3条回答
  •  一向
    一向 (楼主)
    2020-12-23 12:15

    I don't think there's a limit on call stack size*). Usually a stack trace that seems to come out of nowhere results from either

    • an event listener
    • a timeout (window.setTimeout)
    • an interval (window.setInterval)
    • some script loading after page has loaded (possibly iframe)

    *) Of course, technically there certainly is some limit, but I gues it's practically irrelevant. Probably longint or something.


    edit: From Firebug source code:

        if (trace.frames.length > 100)  // TODO in the loop above
        {
            var originalLength = trace.frames.length;
            trace.frames.splice(50, originalLength - 100);
            var excuse = "(eliding "+(originalLength - 100)+" frames)";
    
            trace.frames[50] = new StackFrame.StackFrame({href: excuse}, 0, excuse,
                [], null, null, context);
         }
    

    So Firebug will always show the first 50 and the last 50 items ("frames") of the call stack.

提交回复
热议问题