Skip to content

Commit 4c41c26

Browse files
mydeaisaacs
andauthored
Apply suggestion from @isaacs
Co-authored-by: isaacs <i@izs.me>
1 parent 8d14096 commit 4c41c26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/opentelemetry/src/asyncLocalStorageContextManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ export class SentryAsyncLocalStorageContextManager implements ContextManager {
100100

101101
private _bindFunction(context: Context, target: ListenerFn): ListenerFn {
102102
// oxlint-disable-next-line @typescript-eslint/no-this-alias -- need stable ref for non-arrow wrapper
103-
const manager = this;
103+
const managerWith = this.with.bind(this);
104104
const contextWrapper = function (this: never, ...args: unknown[]) {
105-
return manager.with(context, () => target.apply(this, args));
105+
return managerWith(context, () => target.apply(this, args));
106106
};
107107
Object.defineProperty(contextWrapper, 'length', {
108108
enumerable: false,

0 commit comments

Comments
 (0)