File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,12 @@ function errorDiff(err, type) {
75
75
} ) . join ( '' ) ;
76
76
}
77
77
78
- require ( 'assert' ) . AssertionError . prototype . toString = function ( ) {
78
+ /*
79
+ Do not override .toString() when this.stack is used,
80
+ otherwise this will end in an endless recursive call...
81
+ See issue https://github.com/cloudhead/vows/issues/278#issuecomment-22837493
82
+ */
83
+ require ( 'assert' ) . AssertionError . prototype . toStringEx = function ( ) {
79
84
var that = this ,
80
85
source ;
81
86
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ function addVow(vow) {
136
136
output ( 'honored' ) ;
137
137
} catch ( e ) {
138
138
if ( e . name && e . name . match ( / A s s e r t i o n E r r o r / ) ) {
139
- output ( 'broken' , e . toString ( ) . replace ( / \` / g, '`' ) ) ;
139
+ output ( 'broken' , e . toStringEx ( ) . replace ( / \` / g, '`' ) ) ;
140
140
} else {
141
141
output ( 'errored' , e . stack || e . message || e ) ;
142
142
}
You can’t perform that action at this time.
0 commit comments