aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-sir-writes-alot.js
diff options
context:
space:
mode:
authorGibson Fahnestock <gib@uk.ibm.com>2017-01-08 13:19:00 +0000
committerGibson Fahnestock <gib@uk.ibm.com>2017-01-11 11:43:52 +0000
commit7a0e462f9facfff8ccd7b37eb5b65db1c2b2f55f (patch)
treea971102d320e17e6cb3d00c48fe708b2b86c8136 /test/parallel/test-fs-sir-writes-alot.js
parent1ef401ce92d6195878b9d041cc969612628f5852 (diff)
downloadandroid-node-v8-7a0e462f9facfff8ccd7b37eb5b65db1c2b2f55f.tar.gz
android-node-v8-7a0e462f9facfff8ccd7b37eb5b65db1c2b2f55f.tar.bz2
android-node-v8-7a0e462f9facfff8ccd7b37eb5b65db1c2b2f55f.zip
test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically. 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-fs-sir-writes-alot.js')
-rw-r--r--test/parallel/test-fs-sir-writes-alot.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/parallel/test-fs-sir-writes-alot.js b/test/parallel/test-fs-sir-writes-alot.js
index 85feac59dd..7bf97ff1d5 100644
--- a/test/parallel/test-fs-sir-writes-alot.js
+++ b/test/parallel/test-fs-sir-writes-alot.js
@@ -4,33 +4,35 @@ const fs = require('fs');
const assert = require('assert');
const join = require('path').join;
-var filename = join(common.tmpDir, 'out.txt');
+const filename = join(common.tmpDir, 'out.txt');
common.refreshTmpDir();
-var fd = fs.openSync(filename, 'w');
+const fd = fs.openSync(filename, 'w');
-var line = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa\n';
+const line = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa\n';
-var N = 10240, complete = 0;
-for (var i = 0; i < N; i++) {
+const N = 10240;
+let complete = 0;
+
+for (let i = 0; i < N; i++) {
// Create a new buffer for each write. Before the write is actually
// executed by the thread pool, the buffer will be collected.
- var buffer = Buffer.from(line);
+ const buffer = Buffer.from(line);
fs.write(fd, buffer, 0, buffer.length, null, function(er, written) {
complete++;
if (complete === N) {
fs.closeSync(fd);
- var s = fs.createReadStream(filename);
+ const s = fs.createReadStream(filename);
s.on('data', testBuffer);
}
});
}
-var bytesChecked = 0;
+let bytesChecked = 0;
function testBuffer(b) {
- for (var i = 0; i < b.length; i++) {
+ for (let i = 0; i < b.length; i++) {
bytesChecked++;
if (b[i] !== 'a'.charCodeAt(0) && b[i] !== '\n'.charCodeAt(0)) {
throw new Error('invalid char ' + i + ',' + b[i]);