[Pkg-javascript-commits] [node-leveldown] 139/492: style fixes based on review

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:52 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 d9f71aa3829348c747555e5a3fae9e61ac3c8c5e
Author: David Björklund <david.bjorklund at gmail.com>
Date:   Sun Dec 30 11:38:28 2012 +0100

    style fixes based on review
---
 lib/levelup.js        |  2 +-
 src/database.cc       |  2 +-
 src/database_async.cc |  1 +
 test/simple-test.js   | 50 ++++++++++++++++++++++++++------------------------
 4 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/lib/levelup.js b/lib/levelup.js
index 91ddde2..74ad8d8 100644
--- a/lib/levelup.js
+++ b/lib/levelup.js
@@ -301,7 +301,7 @@ LevelUP.prototype = {
           callback && callback(null, size)
         }
       });
-  }
+    }
 
   , readStream: function (options) {
       options = extend(extend({}, this._options), typeof options == 'object' ? options : {})
diff --git a/src/database.cc b/src/database.cc
index 2929a60..1f6c7ea 100644
--- a/src/database.cc
+++ b/src/database.cc
@@ -94,7 +94,7 @@ void Database::Init () {
   tpl->PrototypeTemplate()->Set(String::NewSymbol("get")      , FunctionTemplate::New(Get)->GetFunction());
   tpl->PrototypeTemplate()->Set(String::NewSymbol("del")      , FunctionTemplate::New(Delete)->GetFunction());
   tpl->PrototypeTemplate()->Set(String::NewSymbol("batch")    , FunctionTemplate::New(Batch)->GetFunction());
-  tpl->PrototypeTemplate()->Set(String::NewSymbol("approximateSize")    , FunctionTemplate::New(ApproximateSize)->GetFunction());
+  tpl->PrototypeTemplate()->Set(String::NewSymbol("approximateSize"), FunctionTemplate::New(ApproximateSize)->GetFunction());
   constructor = Persistent<Function>::New(tpl->GetFunction());
 }
 
diff --git a/src/database_async.cc b/src/database_async.cc
index 555713e..10b57fe 100644
--- a/src/database_async.cc
+++ b/src/database_async.cc
@@ -134,3 +134,4 @@ void ApproximateSizeWorker::HandleOKCallback () {
   };
   RunCallback(callback, argv, 2);
 }
+
diff --git a/test/simple-test.js b/test/simple-test.js
index 4b79361..9d442af 100644
--- a/test/simple-test.js
+++ b/test/simple-test.js
@@ -419,19 +419,20 @@ buster.testCase('Basic API', {
             })
           })
         }
-        , 'apporximateSize() work on none-empty database': function(done) {
+
+      , 'approximateSize() work on none-empty database': function(done) {
           var location = common.nextLocation()
           var db
             async.series(
                 [
                     function (callback) {
-                      levelup(location, { createIfMissing: true, errorIfExists: true }, function (err, _db) {
-                        refute(err)
-                        db = _db
-                        this.closeableDatabases.push(db)
-                        this.cleanupDirs.push(location)
-                        callback()
-                      }.bind(this))
+                      this.openTestDatabase(
+                          location
+                        , function (_db) {
+                          db = _db
+                          callback()
+                        }
+                      )
                     }.bind(this)
                   , function (callback) {
                       var batch = [];
@@ -447,28 +448,29 @@ buster.testCase('Basic API', {
                       )
                     }
                   , function (callback) {
-                    // close db to make sure stuff gets written to disc
-                    db.close(callback)
-                  }
+                      // close db to make sure stuff gets written to disc
+                      db.close(callback)
+                    }
                   , function (callback) {
-                    levelup(location, function (err, _db) {
-                      refute(err)
-                      db = _db
-                      callback()
-                    })
-                  }
+                      levelup(location, function (err, _db) {
+                          refute(err)
+                          db = _db
+                          callback()
+                        }
+                      )
+                    }
                   , function (callback) {
-                    db.approximateSize('', '99', function(err, size) {
-                      refute(err) // sanity
-                      refute.equals(size, 0)
-                      done()
-                    })
-                  }
+                      db.approximateSize('', '99', function(err, size) {
+                        refute(err) // sanity
+                        refute.equals(size, 0)
+                        done()
+                      })
+                    }
                 ]
               , done
             )
         }
-  }
+    }
 
   , 'null and undefined': {
         'setUp': function (done) {

-- 
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