@@ -193,12 +193,7 @@ export function repoStart(repo: Repo): void {
193
193
) ;
194
194
195
195
// Minor hack: Fire onConnect immediately, since there's no actual connection.
196
- setTimeout (
197
- function ( connectStatus : boolean ) {
198
- repoOnConnectStatus ( this , connectStatus ) ;
199
- } . bind ( repo , true ) ,
200
- 0
201
- ) ;
196
+ setTimeout ( ( ) => repoOnConnectStatus ( repo , /* connectStatus= */ true ) , 0 ) ;
202
197
} else {
203
198
const authOverride = repo . app . options [ 'databaseAuthVariableOverride' ] ;
204
199
// Validate authOverride
@@ -807,7 +802,7 @@ export function repoCallOnCompleteCallback(
807
802
}
808
803
809
804
export function repoGetDatabase ( repo : Repo ) : Database {
810
- return repo . __database || ( repo . __database = new Database ( this ) ) ;
805
+ return repo . __database || ( repo . __database = new Database ( repo ) ) ;
811
806
}
812
807
813
808
/**
@@ -830,7 +825,7 @@ export function repoStartTransaction(
830
825
831
826
// Add a watch to make sure we get server updates.
832
827
const valueCallback = function ( ) { } ;
833
- const watchRef = new Reference ( this , path ) ;
828
+ const watchRef = new Reference ( repo , path ) ;
834
829
watchRef . on ( 'value' , valueCallback ) ;
835
830
const unwatcher = function ( ) {
836
831
watchRef . off ( 'value' , valueCallback ) ;
@@ -873,7 +868,7 @@ export function repoStartTransaction(
873
868
// We just set the input snapshot, so this cast should be safe
874
869
const snapshot = new DataSnapshot (
875
870
transaction . currentInputSnapshot ,
876
- new Reference ( this , transaction . path ) ,
871
+ new Reference ( repo , transaction . path ) ,
877
872
PRIORITY_INDEX
878
873
) ;
879
874
transaction . onComplete ( null , false , snapshot ) ;
@@ -936,7 +931,7 @@ export function repoStartTransaction(
936
931
) ;
937
932
eventQueueRaiseEventsForChangedPath ( repo . eventQueue_ , path , events ) ;
938
933
939
- repoSendReadyTransactions ( repo , this . transactionQueueTree_ ) ;
934
+ repoSendReadyTransactions ( repo , repo . transactionQueueTree_ ) ;
940
935
}
941
936
}
942
937
@@ -1069,7 +1064,7 @@ function repoSendTransactionQueue(
1069
1064
repo . transactionQueueTree_ . subTree ( path )
1070
1065
) ;
1071
1066
// There may be pending transactions that we can now send.
1072
- repoSendReadyTransactions ( repo , this . transactionQueueTree_ ) ;
1067
+ repoSendReadyTransactions ( repo , repo . transactionQueueTree_ ) ;
1073
1068
1074
1069
eventQueueRaiseEventsForChangedPath ( repo . eventQueue_ , path , events ) ;
1075
1070
0 commit comments