File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "passfail" : false ,
33 "maxerr" : 20 ,
44 "browser" : true ,
5- "node" : false ,
5+ "node" : true ,
66 "debug" : false ,
77 "devel" : true ,
88 "es5" : false ,
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ test: jshint
22 @./node_modules/.bin/mocha -R spec
33
44jshint :
5- @./node_modules/.bin/jshint Gruntfile.js lib/ * .js test/ * .js
5+ @./node_modules/.bin/jshint Gruntfile.js index .js
66
77.PHONY : jshint test
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ var assert = require ( 'assert' ) ;
4+
15function BufferReader ( buffer ) {
26 assert ( Buffer . isBuffer ( buffer ) , 'A Buffer must be provided' ) ;
37 this . buf = buffer ;
@@ -6,7 +10,7 @@ function BufferReader(buffer) {
610
711BufferReader . prototype . append = function ( buffer ) {
812 assert ( Buffer . isBuffer ( buffer ) , 'A Buffer must be provided' ) ;
9- this . buf = Buffer . concat ( this . buf , buffer ) ;
13+ this . buf = Buffer . concat ( [ this . buf , buffer ] ) ;
1014 return this ;
1115} ;
1216
@@ -32,7 +36,7 @@ BufferReader.prototype.restAll = function() {
3236 assert ( remain >= 0 , 'Buffer is not in normal state: offset > totalLength' ) ;
3337 var buf = new Buffer ( remain ) ;
3438 this . buf . copy ( buf , 0 , this . offset ) ;
35- this . offset += length ;
39+ this . offset = this . buf . length ;
3640 return buf ;
3741} ;
3842
You can’t perform that action at this time.
0 commit comments