Skip to content

Commit 4c18fe2

Browse files
committed
Merge pull request #5 from mjomble/phantomjs-stack
Get stack from thrown error (needed for PhantomJS)
2 parents 6d13514 + 48599d0 commit 4c18fe2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ function AssertionError (message, _props, ssf) {
7070
if (ssf && Error.captureStackTrace) {
7171
Error.captureStackTrace(this, ssf);
7272
} else {
73-
this.stack = new Error().stack;
73+
try {
74+
throw new Error();
75+
} catch(e) {
76+
this.stack = e.stack;
77+
}
7478
}
7579
}
7680

0 commit comments

Comments
 (0)