File tree 1 file changed +14
-13
lines changed
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -799,33 +799,34 @@ function guessHandleType(fd) {
799
799
}
800
800
801
801
class WeakReference {
802
+ #weak = null ;
803
+ #strong = null ;
804
+ #refCount = 0 ;
802
805
constructor ( object ) {
803
- this . weak = new SafeWeakRef ( object ) ;
804
- this . strong = null ;
805
- this . refCount = 0 ;
806
+ this . #weak = new SafeWeakRef ( object ) ;
806
807
}
807
808
808
809
incRef ( ) {
809
- this . refCount ++ ;
810
- if ( this . refCount === 1 ) {
811
- const derefed = this . weak . deref ( ) ;
810
+ this . # refCount++ ;
811
+ if ( this . # refCount === 1 ) {
812
+ const derefed = this . # weak. deref ( ) ;
812
813
if ( derefed !== undefined ) {
813
- this . strong = derefed ;
814
+ this . # strong = derefed ;
814
815
}
815
816
}
816
- return this . refCount ;
817
+ return this . # refCount;
817
818
}
818
819
819
820
decRef ( ) {
820
- this . refCount -- ;
821
- if ( this . refCount === 0 ) {
822
- this . strong = null ;
821
+ this . # refCount-- ;
822
+ if ( this . # refCount === 0 ) {
823
+ this . # strong = null ;
823
824
}
824
- return this . refCount ;
825
+ return this . # refCount;
825
826
}
826
827
827
828
get ( ) {
828
- return this . weak . deref ( ) ;
829
+ return this . # weak. deref ( ) ;
829
830
}
830
831
}
831
832
You can’t perform that action at this time.
0 commit comments