I get some stack overflow problems on the client side Javascript, especially in the IE browser, this happens inside a third-party library that calls some function calls, and for some reason they trade in IE from time to time only because of the low limit stack.
Then I coded a little test HTML to check the stack size limit for some browsers and found that IE8 has a minimal stack limit compared to FF 7 or Chrome 14, which runs on a Windows 7 laptop, with 8 GB RAM:
<html> <body> <script type="text/javascript"> function doSomething(){ var i = 3200; doSomethingElse(i); } function doSomethingElse(i){ if (i == 0) return -1; doSomethingElse(i-1); } doSomething(); </script> </body> </html>
IE increases stack overflow at around 3200, Firefox and Chrome can handle very deep recursion compared to IE.
I would like to know if there is a way to associate the exception with a Javascript function that raised it at runtime in IE or in any other browser, and if it could give stacktrace with a chain of functions on the stack at the time of the error.
javascript stack browser limit
guilhebl Oct 19 '11 at 19:29 2011-10-19 19:29
source share