Skip to content

Commit f119435

Browse files
authored
fix: call RAF with correct context (getsentry#2570)
Fixes getsentry#2352
1 parent 03d9ef0 commit f119435

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

packages/browser/src/integrations/trycatch.ts

+9-11
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,16 @@ export class TryCatch implements Integration {
3838
/** JSDoc */
3939
private _wrapRAF(original: any): (callback: () => void) => any {
4040
return function(this: any, callback: () => void): () => void {
41-
return original(
42-
wrap(callback, {
43-
mechanism: {
44-
data: {
45-
function: 'requestAnimationFrame',
46-
handler: getFunctionName(original),
47-
},
48-
handled: true,
49-
type: 'instrument',
41+
return original.call(this, wrap(callback, {
42+
mechanism: {
43+
data: {
44+
function: 'requestAnimationFrame',
45+
handler: getFunctionName(original),
5046
},
51-
}),
52-
);
47+
handled: true,
48+
type: 'instrument',
49+
},
50+
}));
5351
};
5452
}
5553

0 commit comments

Comments
 (0)