@@ -56,7 +56,6 @@ Agent.prototype.close = function(err) {
56
56
} ;
57
57
58
58
Agent . prototype . _cleanup = function ( ) {
59
-
60
59
// Only clean up once if the stream emits both 'end' and 'close'.
61
60
if ( this . closed ) return ;
62
61
@@ -265,7 +264,7 @@ Agent.prototype._open = function() {
265
264
agent . _handleMessage ( request . data , callback ) ;
266
265
} ) ;
267
266
} ) ;
268
-
267
+
269
268
var cleanup = agent . _cleanup . bind ( agent ) ;
270
269
this . stream . on ( 'end' , cleanup ) ;
271
270
this . stream . on ( 'close' , cleanup ) ;
@@ -333,7 +332,9 @@ Agent.prototype._handleMessage = function(request, callback) {
333
332
} ;
334
333
function getQueryOptions ( request ) {
335
334
var results = request . r ;
336
- var ids , fetch , fetchOps ;
335
+ var ids ;
336
+ var fetch ;
337
+ var fetchOps ;
337
338
if ( results ) {
338
339
ids = [ ] ;
339
340
for ( var i = 0 ; i < results . length ; i ++ ) {
@@ -362,7 +363,6 @@ function getQueryOptions(request) {
362
363
363
364
Agent . prototype . _queryFetch = function ( queryId , collection , query , options , callback ) {
364
365
// Fetch the results of a query once
365
- var agent = this ;
366
366
this . backend . queryFetch ( this , collection , query , options , function ( err , results , extra ) {
367
367
if ( err ) return callback ( err ) ;
368
368
var message = {
@@ -607,10 +607,10 @@ Agent.prototype._createOp = function(request) {
607
607
}
608
608
} ;
609
609
610
- Agent . prototype . _fetchSnapshot = function ( collection , id , version , callback ) {
610
+ Agent . prototype . _fetchSnapshot = function ( collection , id , version , callback ) {
611
611
this . backend . fetchSnapshot ( this , collection , id , version , callback ) ;
612
612
} ;
613
613
614
- Agent . prototype . _fetchSnapshotByTimestamp = function ( collection , id , timestamp , callback ) {
614
+ Agent . prototype . _fetchSnapshotByTimestamp = function ( collection , id , timestamp , callback ) {
615
615
this . backend . fetchSnapshotByTimestamp ( this , collection , id , timestamp , callback ) ;
616
616
} ;
0 commit comments