Skip to content

Commit 2bd838d

Browse files
authored
fix: Fix toString usage for function (#1135)
1 parent 8416fed commit 2bd838d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/raven.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,10 @@ Raven.prototype = {
364364
wrapped.prototype = func.prototype;
365365

366366
func.__raven_wrapper__ = wrapped;
367-
// Signal that this function has been wrapped already
368-
// for both debugging and to prevent it to being wrapped twice
367+
// Signal that this function has been wrapped/filled already
368+
// for both debugging and to prevent it to being wrapped/filled twice
369369
wrapped.__raven__ = true;
370-
wrapped.__inner__ = func;
370+
wrapped.__orig__ = func;
371371

372372
return wrapped;
373373
},
@@ -949,7 +949,7 @@ Raven.prototype = {
949949
// eslint-disable-next-line no-extend-native
950950
Function.prototype.toString = function() {
951951
if (typeof this === 'function' && this.__raven__) {
952-
return self._originalFunctionToString.apply(this.__orig_method__, arguments);
952+
return self._originalFunctionToString.apply(this.__orig__, arguments);
953953
}
954954
return self._originalFunctionToString.apply(this, arguments);
955955
};

src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ function fill(obj, name, replacement, track) {
358358
var orig = obj[name];
359359
obj[name] = replacement(orig);
360360
obj[name].__raven__ = true;
361-
obj[name].__orig_method__ = orig;
361+
obj[name].__orig__ = orig;
362362
if (track) {
363363
track.push([obj, name, orig]);
364364
}

0 commit comments

Comments
 (0)