@@ -241,8 +241,8 @@ export class Observable<T> implements Subscribable<T> {
241
241
* REMOVE THIS ENTIRE METHOD IN VERSION 8.
242
242
*/
243
243
private _deprecatedSyncErrorSubscribe ( subscriber : Subscriber < unknown > ) {
244
- let dest : any = subscriber ;
245
- dest . _syncErrorHack_isSubscribing = true ;
244
+ const localSubscriber : any = subscriber ;
245
+ localSubscriber . _syncErrorHack_isSubscribing = true ;
246
246
const { operator } = this ;
247
247
if ( operator ) {
248
248
// We don't need to try/catch on operators, as they
@@ -253,7 +253,7 @@ export class Observable<T> implements Subscribable<T> {
253
253
try {
254
254
this . _subscribe ( subscriber ) ;
255
255
} catch ( err ) {
256
- dest . __syncError = err ;
256
+ localSubscriber . __syncError = err ;
257
257
}
258
258
}
259
259
@@ -262,6 +262,7 @@ export class Observable<T> implements Subscribable<T> {
262
262
// look to see if there's any synchronously thrown errors.
263
263
// Does this suck for perf? Yes. So stop using the deprecated sync
264
264
// error handling already. We're removing this in v8.
265
+ let dest = localSubscriber ;
265
266
while ( dest ) {
266
267
// Technically, someone could throw something falsy, like 0, or "",
267
268
// so we need to check to see if anything was thrown, and we know
@@ -275,7 +276,8 @@ export class Observable<T> implements Subscribable<T> {
275
276
}
276
277
dest = dest . destination ;
277
278
}
278
- dest . _syncErrorHack_isSubscribing = false ;
279
+
280
+ localSubscriber . _syncErrorHack_isSubscribing = false ;
279
281
}
280
282
281
283
/** @internal */
0 commit comments