File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -178,12 +178,12 @@ var Raven = {
178
178
}
179
179
180
180
function wrapped ( ) {
181
- var args = [ ] , i = arguments . length ;
181
+ var args = [ ] , i = arguments . length ,
182
+ deep = ! options || options && options . deep !== false ;
182
183
// Recursively wrap all of a function's arguments that are
183
184
// functions themselves.
184
- if ( ! options || options && options . deep !== false ) {
185
- while ( i -- ) args [ i ] = Raven . wrap ( options , arguments [ i ] ) ;
186
- }
185
+
186
+ while ( i -- ) args [ i ] = deep ? Raven . wrap ( options , arguments [ i ] ) : arguments [ i ] ;
187
187
188
188
try {
189
189
/*jshint -W040*/
Original file line number Diff line number Diff line change @@ -1066,11 +1066,11 @@ describe('Raven (public API)', function() {
1066
1066
it ( 'should not wrap function arguments' , function ( ) {
1067
1067
var spy = this . sinon . spy ( ) ;
1068
1068
var wrapped = Raven . wrap ( { deep : false } , function ( f ) {
1069
- assert . isTrue ( f . __raven__ ) ;
1069
+ assert . isUndefined ( f . __raven__ ) ;
1070
1070
f ( ) ;
1071
1071
} ) ;
1072
1072
wrapped ( spy ) ;
1073
- assert . isFalse ( spy . calledOnce ) ;
1073
+ assert . isTrue ( spy . calledOnce ) ;
1074
1074
} ) ;
1075
1075
1076
1076
it ( 'should maintain the correct scope' , function ( ) {
You can’t perform that action at this time.
0 commit comments