To add to the answers here, this can depend on the functions involved in the recursion, as well. For example, just adding a few parameters to the function can change the result:
var i=0;
function inc() {
i++;
inc();
}
inc();
gives me 20923, but
var i=0;
function inc(j, k, l) {
i++;
inc(l, k, j);
}
inc(1, 2, 3);
reports 13949 (tested in the console in Chromium 39). Firefox 34 gives 25085 and 13572, respectively.
Adding a try/catch block around the body of the zero-argument inc()
gives 11413 frames in Chromium and 13161 in Firefox. With both 3 arguments and the try/catch block, 8967 in Chrome and 7517 in Firefox.
My takeaway from this is that an application that works near the stack depth in a browser can probably only figure this out based on empirical measurements of functions resembling those used in the app.