@@ -33,6 +33,7 @@ export class AsyncContextStack {
33
33
assignedIsolationScope = isolationScope ;
34
34
}
35
35
36
+ // scope stack for domains or the process
36
37
this . _stack = [ { scope : assignedScope } ] ;
37
38
this . _isolationScope = assignedIsolationScope ;
38
39
}
@@ -90,13 +91,6 @@ export class AsyncContextStack {
90
91
return this . _isolationScope ;
91
92
}
92
93
93
- /**
94
- * Returns the scope stack for domains or the process.
95
- */
96
- public getStack ( ) : Layer [ ] {
97
- return this . _stack ;
98
- }
99
-
100
94
/**
101
95
* Returns the topmost scope layer in the order domain > local > process.
102
96
*/
@@ -110,7 +104,7 @@ export class AsyncContextStack {
110
104
private _pushScope ( ) : ScopeInterface {
111
105
// We want to clone the content of prev scope
112
106
const scope = this . getScope ( ) . clone ( ) ;
113
- this . getStack ( ) . push ( {
107
+ this . _stack . push ( {
114
108
client : this . getClient ( ) ,
115
109
scope,
116
110
} ) ;
@@ -121,8 +115,8 @@ export class AsyncContextStack {
121
115
* Pop a scope from the stack.
122
116
*/
123
117
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 ( ) ;
126
120
}
127
121
}
128
122
0 commit comments