diff --git a/dev/src/index.ts b/dev/src/index.ts index 949cb87bc..b2c052087 100644 --- a/dev/src/index.ts +++ b/dev/src/index.ts @@ -898,10 +898,8 @@ export class Firestore { request.mask = {fieldPaths}; } - const self = this; - return self - .requestStream('batchGetDocuments', request, requestTag) - .then(stream => { + return this.requestStream('batchGetDocuments', request, requestTag).then( + stream => { return new Promise>>((resolve, reject) => { stream .on('error', err => { @@ -924,7 +922,7 @@ export class Firestore { 'Received document: %s', response.found.name! ); - document = self.snapshot_(response.found, response.readTime!); + document = this.snapshot_(response.found, response.readTime!); } else { logger( 'Firestore.getAll_', @@ -932,7 +930,7 @@ export class Firestore { 'Document missing: %s', response.missing! ); - document = self.snapshot_( + document = this.snapshot_( response.missing!, response.readTime! ); @@ -983,7 +981,8 @@ export class Firestore { }); stream.resume(); }); - }); + } + ); } /** diff --git a/dev/src/reference.ts b/dev/src/reference.ts index df580d81e..5cd240fa7 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -1747,14 +1747,12 @@ export class Query { * @param {bytes=} transactionId A transaction ID. */ _get(transactionId?: Uint8Array): Promise> { - const self = this; const docs: Array> = []; return new Promise((resolve, reject) => { let readTime: Timestamp; - self - ._stream(transactionId) + this._stream(transactionId) .on('error', err => { reject(err); })