[Pkg-javascript-commits] [node-leveldown] 176/492: fix: incorrect scope in approximateSize func

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

andrewrk-guest pushed a commit to annotated tag rocksdb-0.10.1
in repository node-leveldown.

commit e7ddbeb2bbc6f9319482a1fa697a5f295c75625c
Author: James Butler <james.butler at sandfox.co.uk>
Date:   Wed Jan 23 12:23:21 2013 +0000

    fix: incorrect scope in approximateSize func
---
 lib/levelup.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/levelup.js b/lib/levelup.js
index 9c3316c..7dc3cc5 100644
--- a/lib/levelup.js
+++ b/lib/levelup.js
@@ -320,7 +320,7 @@ LevelUP.prototype.approximateSize = function(start, end, callback) {
     throw err
   }
 
-  this._db.approximateSize(start, end, function(err, size) {
+  var cb = function(err, size) {
     if (err) {
       err = new errors.OpenError(err)
       if (callback)
@@ -328,7 +328,11 @@ LevelUP.prototype.approximateSize = function(start, end, callback) {
       this.emit('error', err)
     } else if (callback)
       callback(null, size)
-  })
+  }
+
+  cb = cb.bind(this)
+
+  this._db.approximateSize(start, end, cb)
 }
 
 LevelUP.prototype.readStream = function (options) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-leveldown.git



More information about the Pkg-javascript-commits mailing list