diff options
Diffstat (limited to 'test/parallel/test-stream-unshift-empty-chunk.js')
-rw-r--r-- | test/parallel/test-stream-unshift-empty-chunk.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/parallel/test-stream-unshift-empty-chunk.js b/test/parallel/test-stream-unshift-empty-chunk.js index 0da979e337..692b1aa57f 100644 --- a/test/parallel/test-stream-unshift-empty-chunk.js +++ b/test/parallel/test-stream-unshift-empty-chunk.js @@ -2,14 +2,13 @@ require('../common'); var assert = require('assert'); -// This test verifies that stream.unshift(Buffer(0)) or +// This test verifies that stream.unshift(Buffer.alloc(0)) or // stream.unshift('') does not set state.reading=false. var Readable = require('stream').Readable; var r = new Readable(); var nChunks = 10; -var chunk = new Buffer(10); -chunk.fill('x'); +var chunk = Buffer.alloc(10, 'x'); r._read = function(n) { setTimeout(function() { @@ -28,8 +27,7 @@ r.on('readable', function() { // stream, like a parser might do. We just fill it with // 'y' so that it's easy to see which bits were touched, // and which were not. - var putBack = new Buffer(readAll ? 0 : 5); - putBack.fill('y'); + var putBack = Buffer.alloc(readAll ? 0 : 5, 'y'); readAll = !readAll; r.unshift(putBack); } |