summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-parser-bad-ref.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-http-parser-bad-ref.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-http-parser-bad-ref.js')
-rw-r--r--test/parallel/test-http-parser-bad-ref.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/parallel/test-http-parser-bad-ref.js b/test/parallel/test-http-parser-bad-ref.js
index 9eddb2bb3b..69682128fa 100644
--- a/test/parallel/test-http-parser-bad-ref.js
+++ b/test/parallel/test-http-parser-bad-ref.js
@@ -6,15 +6,15 @@
require('../common');
const assert = require('assert');
-var HTTPParser = process.binding('http_parser').HTTPParser;
+const HTTPParser = process.binding('http_parser').HTTPParser;
-var kOnHeaders = HTTPParser.kOnHeaders | 0;
-var kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
-var kOnBody = HTTPParser.kOnBody | 0;
-var kOnMessageComplete = HTTPParser.kOnMessageComplete | 0;
+const kOnHeaders = HTTPParser.kOnHeaders | 0;
+const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
+const kOnBody = HTTPParser.kOnBody | 0;
+const kOnMessageComplete = HTTPParser.kOnMessageComplete | 0;
-var headersComplete = 0;
-var messagesComplete = 0;
+let headersComplete = 0;
+let messagesComplete = 0;
function flushPool() {
Buffer.allocUnsafe(Buffer.poolSize - 1);
@@ -24,7 +24,7 @@ function flushPool() {
function demoBug(part1, part2) {
flushPool();
- var parser = new HTTPParser('REQUEST');
+ const parser = new HTTPParser('REQUEST');
parser.headers = [];
parser.url = '';
@@ -49,7 +49,7 @@ function demoBug(part1, part2) {
// We use a function to eliminate references to the Buffer b
// We want b to be GCed. The parser will hold a bad reference to it.
(function() {
- var b = Buffer.from(part1);
+ const b = Buffer.from(part1);
flushPool();
console.log('parse the first part of the message');
@@ -59,7 +59,7 @@ function demoBug(part1, part2) {
flushPool();
(function() {
- var b = Buffer.from(part2);
+ const b = Buffer.from(part2);
console.log('parse the second part of the message');
parser.execute(b, 0, b.length);