Browse Source

Merge pull request #15 from mafintosh/patch-2

throw instead of returning undefined on error
master
Chris Dickinson 6 years ago
committed by GitHub
parent
commit
f78634a6c3
  1. 2
      decode.js

2
decode.js

@ -15,7 +15,7 @@ function read(buf, offset) {
if(counter >= l) {
read.bytes = 0
read.bytesRead = 0 // DEPRECATED
return undefined
throw new Error('Could not decode varint')
}
b = buf[counter++]
res += shift < 28

Loading…
Cancel
Save