Skip to content

Commit e8522b6

Browse files
committed
fix wrapping option test
1 parent 44015cb commit e8522b6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/raven.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ var Raven = {
178178
}
179179

180180
function wrapped() {
181-
var args = [], i = arguments.length;
181+
var args = [], i = arguments.length,
182+
deep = !options || options && options.deep !== false;
182183
// Recursively wrap all of a function's arguments that are
183184
// 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];
187187

188188
try {
189189
/*jshint -W040*/

test/raven.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,11 +1066,11 @@ describe('Raven (public API)', function() {
10661066
it('should not wrap function arguments', function() {
10671067
var spy = this.sinon.spy();
10681068
var wrapped = Raven.wrap({ deep: false }, function(f) {
1069-
assert.isTrue(f.__raven__);
1069+
assert.isUndefined(f.__raven__);
10701070
f();
10711071
});
10721072
wrapped(spy);
1073-
assert.isFalse(spy.calledOnce);
1073+
assert.isTrue(spy.calledOnce);
10741074
});
10751075

10761076
it('should maintain the correct scope', function() {

0 commit comments

Comments
 (0)