@@ -142,18 +142,6 @@ export class Hub implements HubInterface {
142142 this . _isolationScope = assignedIsolationScope ;
143143 }
144144
145- /**
146- * Checks if this hub's version is older than the given version.
147- *
148- * @param version A version number to compare to.
149- * @return True if the given version is newer; otherwise false.
150- *
151- * @deprecated This will be removed in v8.
152- */
153- public isOlderThan ( version : number ) : boolean {
154- return this . _version < version ;
155- }
156-
157145 /**
158146 * This binds the given client to the current scope.
159147 * @param client An SDK client (client) instance.
@@ -170,72 +158,37 @@ export class Hub implements HubInterface {
170158 }
171159 }
172160
173- /**
174- * @inheritDoc
175- *
176- * @deprecated Use `withScope` instead.
177- */
178- public pushScope ( ) : ScopeInterface {
179- // We want to clone the content of prev scope
180- // eslint-disable-next-line deprecation/deprecation
181- const scope = this . getScope ( ) . clone ( ) ;
182- // eslint-disable-next-line deprecation/deprecation
183- this . getStack ( ) . push ( {
184- // eslint-disable-next-line deprecation/deprecation
185- client : this . getClient ( ) ,
186- scope,
187- } ) ;
188- return scope ;
189- }
190-
191- /**
192- * @inheritDoc
193- *
194- * @deprecated Use `withScope` instead.
195- */
196- public popScope ( ) : boolean {
197- // eslint-disable-next-line deprecation/deprecation
198- if ( this . getStack ( ) . length <= 1 ) return false ;
199- // eslint-disable-next-line deprecation/deprecation
200- return ! ! this . getStack ( ) . pop ( ) ;
201- }
202-
203161 /**
204162 * @inheritDoc
205163 *
206164 * @deprecated Use `Sentry.withScope()` instead.
207165 */
208166 public withScope < T > ( callback : ( scope : ScopeInterface ) => T ) : T {
209- // eslint-disable-next-line deprecation/deprecation
210- const scope = this . pushScope ( ) ;
167+ const scope = this . _pushScope ( ) ;
211168
212169 let maybePromiseResult : T ;
213170 try {
214171 maybePromiseResult = callback ( scope ) ;
215172 } catch ( e ) {
216- // eslint-disable-next-line deprecation/deprecation
217- this . popScope ( ) ;
173+ this . _popScope ( ) ;
218174 throw e ;
219175 }
220176
221177 if ( isThenable ( maybePromiseResult ) ) {
222178 // @ts -expect-error - isThenable returns the wrong type
223179 return maybePromiseResult . then (
224180 res => {
225- // eslint-disable-next-line deprecation/deprecation
226- this . popScope ( ) ;
181+ this . _popScope ( ) ;
227182 return res ;
228183 } ,
229184 e => {
230- // eslint-disable-next-line deprecation/deprecation
231- this . popScope ( ) ;
185+ this . _popScope ( ) ;
232186 throw e ;
233187 } ,
234188 ) ;
235189 }
236190
237- // eslint-disable-next-line deprecation/deprecation
238- this . popScope ( ) ;
191+ this . _popScope ( ) ;
239192 return maybePromiseResult ;
240193 }
241194
@@ -501,20 +454,6 @@ export class Hub implements HubInterface {
501454 return session ;
502455 }
503456
504- /**
505- * Returns if default PII should be sent to Sentry and propagated in ourgoing requests
506- * when Tracing is used.
507- *
508- * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function
509- * only unnecessarily increased API surface but only wrapped accessing the option.
510- */
511- public shouldSendDefaultPii ( ) : boolean {
512- // eslint-disable-next-line deprecation/deprecation
513- const client = this . getClient ( ) ;
514- const options = client && client . getOptions ( ) ;
515- return Boolean ( options && options . sendDefaultPii ) ;
516- }
517-
518457 /**
519458 * Sends the current Session on the scope
520459 */
@@ -527,6 +466,32 @@ export class Hub implements HubInterface {
527466 client . captureSession ( session ) ;
528467 }
529468 }
469+
470+ /**
471+ * Push a scope to the stack.
472+ */
473+ private _pushScope ( ) : ScopeInterface {
474+ // We want to clone the content of prev scope
475+ // eslint-disable-next-line deprecation/deprecation
476+ const scope = this . getScope ( ) . clone ( ) ;
477+ // eslint-disable-next-line deprecation/deprecation
478+ this . getStack ( ) . push ( {
479+ // eslint-disable-next-line deprecation/deprecation
480+ client : this . getClient ( ) ,
481+ scope,
482+ } ) ;
483+ return scope ;
484+ }
485+
486+ /**
487+ * Pop a scope from the stack.
488+ */
489+ private _popScope ( ) : boolean {
490+ // eslint-disable-next-line deprecation/deprecation
491+ if ( this . getStack ( ) . length <= 1 ) return false ;
492+ // eslint-disable-next-line deprecation/deprecation
493+ return ! ! this . getStack ( ) . pop ( ) ;
494+ }
530495}
531496
532497/**
0 commit comments