[Pkg-javascript-commits] [node-sha.js] 11/31: hash: update never returns anything

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 30 11:23:26 UTC 2017


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

rouca pushed a commit to branch master
in repository node-sha.js.

commit d308cb0004a0f3e0fcb7a27ea52868384c654c95
Author: Daniel Cousens <dcousens at users.noreply.github.com>
Date:   Fri May 19 19:45:14 2017 +1000

    hash: update never returns anything
---
 hash.js      | 3 ++-
 test/hash.js | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/hash.js b/hash.js
index ff8fb90..0841769 100644
--- a/hash.js
+++ b/hash.js
@@ -64,7 +64,8 @@ Hash.prototype.digest = function (enc) {
     this._block.writeUInt32BE(ll, this._blockSize - 4)
   }
 
-  var hash = this._update(this._block) || this._hash()
+  this._update(this._block)
+  var hash = this._hash()
 
   return enc ? hash.toString(enc) : hash
 }
diff --git a/test/hash.js b/test/hash.js
index cd4d6c5..618b9f1 100644
--- a/test/hash.js
+++ b/test/hash.js
@@ -43,7 +43,6 @@ var long = {
 
 function makeTest (name, data) {
   tape(name, function (t) {
-
     var h = new Hash(16, 8)
     var hash = new Buffer(20)
     var n = 2
@@ -57,7 +56,8 @@ function makeTest (name, data) {
       if (n < 0) {
         throw new Error('expecting only 2 calls to _update')
       }
-
+    }
+    h._hash = function () {
       return hash
     }
 

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



More information about the Pkg-javascript-commits mailing list