Skip to content

Commit

Permalink
Merge pull request #13366 from breeeew/fix-request-scope-leak
Browse files Browse the repository at this point in the history
fix(core): break reference chain to instance object
  • Loading branch information
kamilmysliwiec committed Mar 27, 2024
2 parents ccbbe06 + 6a7f74f commit f29f932
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/core/helpers/context-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,11 @@ export class ContextUtils {
instance?: object,
callback?: Function,
): (args: unknown[]) => ExecutionContextHost {
const contextFactory = (args: unknown[]) => {
const ctx = new ExecutionContextHost(
args,
instance && (instance.constructor as Type<unknown>),
callback,
);
const type = instance && (instance.constructor as Type<unknown>);
return (args: unknown[]) => {
const ctx = new ExecutionContextHost(args, type, callback);
ctx.setType(contextType);
return ctx;
};
return contextFactory;
}
}

0 comments on commit f29f932

Please sign in to comment.