diff options
author | Gibson Fahnestock <gibfahn@gmail.com> | 2017-03-09 18:11:21 +0000 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-04-18 20:01:49 -0400 |
commit | db61c952de2aa4591c60f4772fa62f0bc3474577 (patch) | |
tree | 9e585bb427b689eeb8ec431f6e8515595c7e6e5d /test/parallel/test-stream-unshift-empty-chunk.js | |
parent | de636980668017c2ed155ba6f75ac5e6a2af647b (diff) | |
download | node-new-db61c952de2aa4591c60f4772fa62f0bc3474577.tar.gz |
test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically.
Backport-PR-URL: https://github.com/nodejs/node/pull/11775
PR-URL: https://github.com/nodejs/node/pull/10685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'test/parallel/test-stream-unshift-empty-chunk.js')
-rw-r--r-- | test/parallel/test-stream-unshift-empty-chunk.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/parallel/test-stream-unshift-empty-chunk.js b/test/parallel/test-stream-unshift-empty-chunk.js index 477f5c4be5..d555fd7cae 100644 --- a/test/parallel/test-stream-unshift-empty-chunk.js +++ b/test/parallel/test-stream-unshift-empty-chunk.js @@ -1,14 +1,14 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // This test verifies that stream.unshift(Buffer.alloc(0)) or // stream.unshift('') does not set state.reading=false. -var Readable = require('stream').Readable; +const Readable = require('stream').Readable; -var r = new Readable(); -var nChunks = 10; -var chunk = Buffer.alloc(10, 'x'); +const r = new Readable(); +let nChunks = 10; +const chunk = Buffer.alloc(10, 'x'); r._read = function(n) { setImmediate(function() { @@ -16,10 +16,10 @@ r._read = function(n) { }); }; -var readAll = false; -var seen = []; +let readAll = false; +const seen = []; r.on('readable', function() { - var chunk; + let chunk; while (chunk = r.read()) { seen.push(chunk.toString()); // simulate only reading a certain amount of the data, @@ -27,13 +27,13 @@ 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 = Buffer.alloc(readAll ? 0 : 5, 'y'); + const putBack = Buffer.alloc(readAll ? 0 : 5, 'y'); readAll = !readAll; r.unshift(putBack); } }); -var expect = +const expect = [ 'xxxxxxxxxx', 'yyyyy', 'xxxxxxxxxx', |