File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -799,33 +799,34 @@ function guessHandleType(fd) {
799799}
800800
801801class WeakReference {
802+ #weak = null ;
803+ #strong = null ;
804+ #refCount = 0 ;
802805 constructor ( object ) {
803- this . weak = new SafeWeakRef ( object ) ;
804- this . strong = null ;
805- this . refCount = 0 ;
806+ this . #weak = new SafeWeakRef ( object ) ;
806807 }
807808
808809 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 ( ) ;
812813 if ( derefed !== undefined ) {
813- this . strong = derefed ;
814+ this . # strong = derefed ;
814815 }
815816 }
816- return this . refCount ;
817+ return this . # refCount;
817818 }
818819
819820 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 ;
823824 }
824- return this . refCount ;
825+ return this . # refCount;
825826 }
826827
827828 get ( ) {
828- return this . weak . deref ( ) ;
829+ return this . # weak. deref ( ) ;
829830 }
830831}
831832
You can’t perform that action at this time.
0 commit comments