Skip to content

Commit

Permalink
Remove unnecessary this overwrite in stack context manager (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan authored Mar 19, 2020
1 parent d2dc12f commit aa3902f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/opentelemetry-web/src/StackContextManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export class StackContextManager implements ContextManager {
context = Context.ROOT_CONTEXT
): T {
const manager = this;
const contextWrapper = function(...args: unknown[]) {
return manager.with(context, () => target.apply(context, args));
const contextWrapper = function(this: any, ...args: any[]) {
return manager.with(context, () => target.apply(this, args));
};
Object.defineProperty(contextWrapper, 'length', {
enumerable: false,
Expand Down Expand Up @@ -112,7 +112,7 @@ export class StackContextManager implements ContextManager {
this._currentContext = context || Context.ROOT_CONTEXT;

try {
return fn.apply(context);
return fn();
} catch (err) {
throw err;
} finally {
Expand Down

0 comments on commit aa3902f

Please sign in to comment.