Skip to content

Commit

Permalink
Add longStackJumpLimit.
Browse files Browse the repository at this point in the history
- Closes kriskowal#168, since you can set it to `0` to disable long stack traces entirely.
- Plants the seeds for kriskowal#144.
  • Loading branch information
domenic committed Jan 11, 2013
1 parent a211a6d commit e0b64e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion q.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ if (typeof ReturnValue !== "undefined") {

// long stack traces

Q.longStackJumpLimit = 1;

var STACK_JUMP_SEPARATOR = "From previous event:";

function makeStackTraceLong(error, promise) {
Expand Down Expand Up @@ -376,7 +378,7 @@ function defer() {
return value;
};

if (Error.captureStackTrace) {
if (Error.captureStackTrace && Q.longStackJumpLimit > 0) {
Error.captureStackTrace(promise, defer);

// Reify the stack into a string by using the accessor; this prevents
Expand Down

0 comments on commit e0b64e7

Please sign in to comment.