Skip to content

Commit 3a00b45

Browse files
committed
Merge pull request #144 from matthewwithanm/return-from-context
Return result of wrapped function from context
2 parents d3c7117 + e3d46ce commit 3a00b45

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/raven.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ var Raven = {
140140
options = undefined;
141141
}
142142

143-
Raven.wrap(options, func).apply(this, args);
143+
return Raven.wrap(options, func).apply(this, args);
144144
},
145145

146146
/*

test/raven.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,12 @@ describe('Raven (public API)', function() {
956956
Raven.context(spy);
957957
assert.deepEqual(spy.lastCall.args, []);
958958
});
959+
960+
it('should return the result of the wrapped function', function() {
961+
var val = {};
962+
var func = function() { return val; };
963+
assert.equal(Raven.context(func), val);
964+
});
959965
});
960966

961967
describe('.uninstall', function() {

0 commit comments

Comments
 (0)