1) Probing the stack limit:
function stackLimit() {
var n = 0;
function recurse() { n++; recurse(); }
try { recurse(); } catch (e) {}
return n;
}
2) Counting stack trace length (However by default stack traces are limited to 10 frames. It can be increased by settings Error.stackTraceLimit http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi )
function stackDepth() {
return new Error().stack.split("\n").length - 1;
}
-tom
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en