Skip to content

Commit 39eca1e

Browse files
committed
also copy function properties while wrapping function
1 parent 0017154 commit 39eca1e

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/raven.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,21 @@ var Raven = {
156156
options = undefined;
157157
}
158158

159-
return function() {
160-
try {
161-
return func.apply(this, arguments);
162-
} catch(e) {
163-
Raven.captureException(e, options);
164-
throw e;
165-
}
166-
};
159+
var property,
160+
wrappedFunction = function() {
161+
try {
162+
func.apply(this, arguments);
163+
} catch(e) {
164+
Raven.captureException(e, options);
165+
throw e;
166+
}
167+
};
168+
169+
for (property in func) {
170+
wrappedFunction[property] = func[property];
171+
}
172+
173+
return wrappedFunction;
167174
},
168175

169176
/*

0 commit comments

Comments
 (0)