Skip to content

Commit aa3902f

Browse files
authored
Remove unnecessary this overwrite in stack context manager (#873)
1 parent d2dc12f commit aa3902f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/opentelemetry-web/src/StackContextManager.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export class StackContextManager implements ContextManager {
4242
context = Context.ROOT_CONTEXT
4343
): T {
4444
const manager = this;
45-
const contextWrapper = function(...args: unknown[]) {
46-
return manager.with(context, () => target.apply(context, args));
45+
const contextWrapper = function(this: any, ...args: any[]) {
46+
return manager.with(context, () => target.apply(this, args));
4747
};
4848
Object.defineProperty(contextWrapper, 'length', {
4949
enumerable: false,
@@ -112,7 +112,7 @@ export class StackContextManager implements ContextManager {
112112
this._currentContext = context || Context.ROOT_CONTEXT;
113113

114114
try {
115-
return fn.apply(context);
115+
return fn();
116116
} catch (err) {
117117
throw err;
118118
} finally {

0 commit comments

Comments
 (0)