@@ -2367,6 +2367,8 @@ class WorkerTransport {
2367
2367
2368
2368
#pagePromises = new Map ( ) ;
2369
2369
2370
+ #passwordCapability = null ;
2371
+
2370
2372
constructor ( messageHandler , loadingTask , networkStream , params , factory ) {
2371
2373
this . messageHandler = messageHandler ;
2372
2374
this . loadingTask = loadingTask ;
@@ -2384,7 +2386,6 @@ class WorkerTransport {
2384
2386
2385
2387
this . destroyed = false ;
2386
2388
this . destroyCapability = null ;
2387
- this . _passwordCapability = null ;
2388
2389
2389
2390
this . _networkStream = networkStream ;
2390
2391
this . _fullReader = null ;
@@ -2495,11 +2496,9 @@ class WorkerTransport {
2495
2496
this . destroyed = true ;
2496
2497
this . destroyCapability = new PromiseCapability ( ) ;
2497
2498
2498
- if ( this . _passwordCapability ) {
2499
- this . _passwordCapability . reject (
2500
- new Error ( "Worker was destroyed during onPassword callback" )
2501
- ) ;
2502
- }
2499
+ this . #passwordCapability?. reject (
2500
+ new Error ( "Worker was destroyed during onPassword callback" )
2501
+ ) ;
2503
2502
2504
2503
const waitOn = [ ] ;
2505
2504
// We need to wait for all renderings to be completed, e.g.
@@ -2702,27 +2701,27 @@ class WorkerTransport {
2702
2701
} ) ;
2703
2702
2704
2703
messageHandler . on ( "PasswordRequest" , exception => {
2705
- this . _passwordCapability = new PromiseCapability ( ) ;
2704
+ this . #passwordCapability = new PromiseCapability ( ) ;
2706
2705
2707
2706
if ( loadingTask . onPassword ) {
2708
2707
const updatePassword = password => {
2709
2708
if ( password instanceof Error ) {
2710
- this . _passwordCapability . reject ( password ) ;
2709
+ this . #passwordCapability . reject ( password ) ;
2711
2710
} else {
2712
- this . _passwordCapability . resolve ( { password } ) ;
2711
+ this . #passwordCapability . resolve ( { password } ) ;
2713
2712
}
2714
2713
} ;
2715
2714
try {
2716
2715
loadingTask . onPassword ( updatePassword , exception . code ) ;
2717
2716
} catch ( ex ) {
2718
- this . _passwordCapability . reject ( ex ) ;
2717
+ this . #passwordCapability . reject ( ex ) ;
2719
2718
}
2720
2719
} else {
2721
- this . _passwordCapability . reject (
2720
+ this . #passwordCapability . reject (
2722
2721
new PasswordException ( exception . message , exception . code )
2723
2722
) ;
2724
2723
}
2725
- return this . _passwordCapability . promise ;
2724
+ return this . #passwordCapability . promise ;
2726
2725
} ) ;
2727
2726
2728
2727
messageHandler . on ( "DataLoaded" , data => {
0 commit comments