Skip to content

Commit

Permalink
Unbreak most tests in Phantom.js by making sure that new UnexpectedEr…
Browse files Browse the repository at this point in the history
…ror has a defined stack even when Error.captureStackTrace is unavailable.
  • Loading branch information
papandreou committed Apr 29, 2015
1 parent 92dd13b commit 5dcd441
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/UnexpectedError.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function UnexpectedError(expect, assertion, parent) {
if (Error.captureStackTrace) {
Error.captureStackTrace(this, UnexpectedError);
} else {
// Throw the error to make sure it has its stack serialized:
try { throw base; } catch (err) {}
this.stack = base.stack;
}

Expand Down

0 comments on commit 5dcd441

Please sign in to comment.