summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEvan Oxfeld <eoxfeld@nearinfinity.com>2013-03-01 15:10:36 -0500
committerisaacs <i@izs.me>2013-03-01 14:21:34 -0800
commit16ddc545bd8004868122520f0cc7560cc63750e8 (patch)
tree5be99d21e8c080fe0d82fff676968dad2986926c /doc
parent6366a3057ccb2fc42aba2c23d26e496eb836dee0 (diff)
downloadandroid-node-v8-16ddc545bd8004868122520f0cc7560cc63750e8.tar.gz
android-node-v8-16ddc545bd8004868122520f0cc7560cc63750e8.tar.bz2
android-node-v8-16ddc545bd8004868122520f0cc7560cc63750e8.zip
doc: Fix readable.unshift() example
Slice the portion of the buffer to unshift back into the read queue
Diffstat (limited to 'doc')
-rw-r--r--doc/api/stream.markdown1
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown
index 86f45ca9f9..1590df5ad5 100644
--- a/doc/api/stream.markdown
+++ b/doc/api/stream.markdown
@@ -264,6 +264,7 @@ SimpleProtocol.prototype._read = function(n) {
}
// now, because we got some extra data, unshift the rest
// back into the read queue so that our consumer will see it.
+ var b = chunk.slice(split);
this.unshift(b);
// and let them know that we are done parsing the header.