@@ -2319,13 +2319,9 @@ firebase.firestore.collection = (collectionPath: string): firestore.CollectionRe
23192319firebase . firestore . onDocumentSnapshot = ( docRef : com . google . firebase . firestore . DocumentReference , callback : ( doc : DocumentSnapshot ) => void ) : ( ) => void => {
23202320 const listener = docRef . addSnapshotListener ( new com . google . firebase . firestore . EventListener ( {
23212321 onEvent : ( ( snapshot : com . google . firebase . firestore . DocumentSnapshot , exception ) => {
2322- if ( exception ! == null ) {
2323- return ;
2322+ if ( exception = == null ) {
2323+ callback ( new DocumentSnapshot ( snapshot ? snapshot . getId ( ) : null , snapshot . exists ( ) , firebase . toJsObject ( snapshot . getData ( ) ) ) ) ;
23242324 }
2325- callback ( new DocumentSnapshot (
2326- snapshot ? snapshot . getId ( ) : null ,
2327- snapshot . exists ( ) ,
2328- ( ) => snapshot . exists ( ) ? firebase . toJsObject ( snapshot . getData ( ) ) : undefined ) ) ;
23292325 } )
23302326 } )
23312327 ) ;
@@ -2343,7 +2339,7 @@ firebase.firestore.onCollectionSnapshot = (colRef: com.google.firebase.firestore
23432339 const docSnapshots : Array < firestore . DocumentSnapshot > = [ ] ;
23442340 for ( let i = 0 ; i < snapshot . size ( ) ; i ++ ) {
23452341 const documentSnapshot : com . google . firebase . firestore . DocumentSnapshot = snapshot . getDocuments ( ) . get ( i ) ;
2346- docSnapshots . push ( new DocumentSnapshot ( documentSnapshot . getId ( ) , true , ( ) => firebase . toJsObject ( documentSnapshot . getData ( ) ) ) ) ;
2342+ docSnapshots . push ( new DocumentSnapshot ( documentSnapshot . getId ( ) , true , firebase . toJsObject ( documentSnapshot . getData ( ) ) ) ) ;
23472343 }
23482344 const snap = new QuerySnapshot ( ) ;
23492345 snap . docSnapshots = docSnapshots ;
@@ -2550,7 +2546,7 @@ firebase.firestore.getCollection = (collectionPath: string): Promise<firestore.Q
25502546 const docSnapshots : Array < firestore . DocumentSnapshot > = [ ] ;
25512547 for ( let i = 0 ; i < result . size ( ) ; i ++ ) {
25522548 const documentSnapshot : com . google . firebase . firestore . DocumentSnapshot = result . getDocuments ( ) . get ( i ) ;
2553- docSnapshots . push ( new DocumentSnapshot ( documentSnapshot . getId ( ) , true , ( ) => firebase . toJsObject ( documentSnapshot . getData ( ) ) ) ) ;
2549+ docSnapshots . push ( new DocumentSnapshot ( documentSnapshot . getId ( ) , true , firebase . toJsObject ( documentSnapshot . getData ( ) ) ) ) ;
25542550 }
25552551 const snap = new QuerySnapshot ( ) ;
25562552 snap . docSnapshots = docSnapshots ;
@@ -2600,7 +2596,7 @@ firebase.firestore.getDocument = (collectionPath: string, documentPath: string):
26002596 } else {
26012597 const result : com . google . firebase . firestore . DocumentSnapshot = task . getResult ( ) ;
26022598 const exists = result . exists ( ) ;
2603- resolve ( new DocumentSnapshot ( exists ? result . getId ( ) : null , exists , ( ) => exists ? firebase . toJsObject ( result . getData ( ) ) : null ) ) ;
2599+ resolve ( new DocumentSnapshot ( exists ? result . getId ( ) : null , exists , firebase . toJsObject ( result . getData ( ) ) ) ) ;
26042600 }
26052601 }
26062602 } ) ;
@@ -2637,7 +2633,7 @@ firebase.firestore._getQuery = (collectionPath: string, query: com.google.fireba
26372633 const docSnapshots : Array < firestore . DocumentSnapshot > = [ ] ;
26382634 for ( let i = 0 ; i < result . size ( ) ; i ++ ) {
26392635 const documentSnapshot : com . google . firebase . firestore . DocumentSnapshot = result . getDocuments ( ) . get ( i ) ;
2640- docSnapshots . push ( new DocumentSnapshot ( documentSnapshot . getId ( ) , true , ( ) => firebase . toJsObject ( documentSnapshot . getData ( ) ) ) ) ;
2636+ docSnapshots . push ( new DocumentSnapshot ( documentSnapshot . getId ( ) , true , firebase . toJsObject ( documentSnapshot . getData ( ) ) ) ) ;
26412637 }
26422638 const snap = new QuerySnapshot ( ) ;
26432639 snap . docSnapshots = docSnapshots ;
0 commit comments