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) {
322322 return ! ! ( ! ! a ^ ! ! b ) ;
323323}
324324
325+ /**
326+ * Returns true if both parameters are undefined
327+ */
328+ function isBothUndefined ( a , b ) {
329+ return isUndefined ( a ) && isUndefined ( b ) ;
330+ }
331+
325332/**
326333 * Returns true if the two input exception interfaces have the same content
327334 */
@@ -333,6 +340,9 @@ function isSameException(ex1, ex2) {
333340
334341 if ( ex1 . type !== ex2 . type || ex1 . value !== ex2 . value ) return false ;
335342
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+
336346 return isSameStacktrace ( ex1 . stacktrace , ex2 . stacktrace ) ;
337347}
338348
Original file line number Diff line number Diff line change @@ -3527,6 +3527,14 @@ describe('Raven (private methods)', function() {
35273527 data . exception . values [ 0 ] . stacktrace . frames = [ ] ;
35283528 assert . isFalse ( Raven . _isRepeatData ( data ) ) ;
35293529 } ) ;
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+ } ) ;
35303538 } ) ;
35313539 } ) ;
35323540} ) ;
You can’t perform that action at this time.
0 commit comments