Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(scope): Delete unused public getStack() #12737

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions packages/core/src/asyncContext/stackStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class AsyncContextStack {
assignedIsolationScope = isolationScope;
}

// scope stack for domains or the process
this._stack = [{ scope: assignedScope }];
this._isolationScope = assignedIsolationScope;
}
Expand Down Expand Up @@ -90,13 +91,6 @@ export class AsyncContextStack {
return this._isolationScope;
}

/**
* Returns the scope stack for domains or the process.
*/
public getStack(): Layer[] {
return this._stack;
}

/**
* Returns the topmost scope layer in the order domain > local > process.
*/
Expand All @@ -110,7 +104,7 @@ export class AsyncContextStack {
private _pushScope(): ScopeInterface {
// We want to clone the content of prev scope
const scope = this.getScope().clone();
this.getStack().push({
this._stack.push({
client: this.getClient(),
scope,
});
Expand All @@ -121,8 +115,8 @@ export class AsyncContextStack {
* Pop a scope from the stack.
*/
private _popScope(): boolean {
if (this.getStack().length <= 1) return false;
return !!this.getStack().pop();
if (this._stack.length <= 1) return false;
return !!this._stack.pop();
}
}

Expand Down
Loading