File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,13 @@ function isOnlyOneTruthy(a, b) {
322
322
return ! ! ( ! ! a ^ ! ! b ) ;
323
323
}
324
324
325
+ /**
326
+ * Returns true if both parameters are undefined
327
+ */
328
+ function isBothUndefined ( a , b ) {
329
+ return isUndefined ( a ) && isUndefined ( b ) ;
330
+ }
331
+
325
332
/**
326
333
* Returns true if the two input exception interfaces have the same content
327
334
*/
@@ -333,6 +340,9 @@ function isSameException(ex1, ex2) {
333
340
334
341
if ( ex1 . type !== ex2 . type || ex1 . value !== ex2 . value ) return false ;
335
342
343
+ // in case both stacktraces are undefined, we can't decide so default to false
344
+ if ( isBothUndefined ( ex1 . stacktrace , ex2 . stacktrace ) ) return false ;
345
+
336
346
return isSameStacktrace ( ex1 . stacktrace , ex2 . stacktrace ) ;
337
347
}
338
348
Original file line number Diff line number Diff line change @@ -3527,6 +3527,14 @@ describe('Raven (private methods)', function() {
3527
3527
data . exception . values [ 0 ] . stacktrace . frames = [ ] ;
3528
3528
assert . isFalse ( Raven . _isRepeatData ( data ) ) ;
3529
3529
} ) ;
3530
+
3531
+ it ( 'should not blown if both stacktraces are undefined' , function ( ) {
3532
+ Raven . _lastData . exception . values [ 0 ] . stacktrace = undefined ;
3533
+ var data1 = JSON . parse ( JSON . stringify ( Raven . _lastData ) ) ; // copy
3534
+ var data2 = JSON . parse ( JSON . stringify ( Raven . _lastData ) ) ; // copy
3535
+ assert . isFalse ( Raven . _isRepeatData ( data1 ) ) ;
3536
+ assert . isFalse ( Raven . _isRepeatData ( data2 ) ) ;
3537
+ } ) ;
3530
3538
} ) ;
3531
3539
} ) ;
3532
3540
} ) ;
You can’t perform that action at this time.
0 commit comments