doc: fix streams2 SimpleProtocol example
A non-existing variable `b` was used to queue data for reading.
This commit is contained in:
parent
bf83251eea
commit
2f4a62c5e1
@ -717,11 +717,11 @@ SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
|
||||
this.emit('header', this.header);
|
||||
|
||||
// now, because we got some extra data, emit this first.
|
||||
this.push(b);
|
||||
this.push(chunk.slice(split));
|
||||
}
|
||||
} else {
|
||||
// from there on, just provide the data to our consumer as-is.
|
||||
this.push(b);
|
||||
this.push(chunk);
|
||||
}
|
||||
done();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user