@@ -33,6 +33,7 @@ export class AsyncContextStack {
3333 assignedIsolationScope = isolationScope ;
3434 }
3535
36+ // scope stack for domains or the process
3637 this . _stack = [ { scope : assignedScope } ] ;
3738 this . _isolationScope = assignedIsolationScope ;
3839 }
@@ -90,13 +91,6 @@ export class AsyncContextStack {
9091 return this . _isolationScope ;
9192 }
9293
93- /**
94- * Returns the scope stack for domains or the process.
95- */
96- public getStack ( ) : Layer [ ] {
97- return this . _stack ;
98- }
99-
10094 /**
10195 * Returns the topmost scope layer in the order domain > local > process.
10296 */
@@ -110,7 +104,7 @@ export class AsyncContextStack {
110104 private _pushScope ( ) : ScopeInterface {
111105 // We want to clone the content of prev scope
112106 const scope = this . getScope ( ) . clone ( ) ;
113- this . getStack ( ) . push ( {
107+ this . _stack . push ( {
114108 client : this . getClient ( ) ,
115109 scope,
116110 } ) ;
@@ -121,8 +115,8 @@ export class AsyncContextStack {
121115 * Pop a scope from the stack.
122116 */
123117 private _popScope ( ) : boolean {
124- if ( this . getStack ( ) . length <= 1 ) return false ;
125- return ! ! this . getStack ( ) . pop ( ) ;
118+ if ( this . _stack . length <= 1 ) return false ;
119+ return ! ! this . _stack . pop ( ) ;
126120 }
127121}
128122
0 commit comments