mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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>
This commit is contained in:
1 parent
de63698066
commit
db61c952de
806 files changed
+5031
-4995
No files matched your search
@@ -1,22 +1,22 @@
|
||||
'use strict';
|
||||
var common = require('../common');
|
||||
var assert = require('assert');
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
|
||||
if (!common.hasCrypto) {
|
||||
common.skip('missing crypto');
|
||||
return;
|
||||
}
|
||||
var https = require('https');
|
||||
const https = require('https');
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
var options = {
|
||||
const options = {
|
||||
key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')),
|
||||
cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'))
|
||||
};
|
||||
|
||||
var server = https.createServer(options, common.mustCall(function(req, res) {
|
||||
const server = https.createServer(options, common.mustCall(function(req, res) {
|
||||
res.writeHead(200);
|
||||
res.end();
|
||||
req.resume();
|
||||
@@ -25,7 +25,7 @@ var server = https.createServer(options, common.mustCall(function(req, res) {
|
||||
});
|
||||
|
||||
function unauthorized() {
|
||||
var req = https.request({
|
||||
const req = https.request({
|
||||
port: server.address().port,
|
||||
rejectUnauthorized: false
|
||||
}, function(res) {
|
||||
@@ -40,11 +40,11 @@ function unauthorized() {
|
||||
}
|
||||
|
||||
function rejectUnauthorized() {
|
||||
var options = {
|
||||
const options = {
|
||||
port: server.address().port
|
||||
};
|
||||
options.agent = new https.Agent(options);
|
||||
var req = https.request(options, common.fail);
|
||||
const req = https.request(options, common.fail);
|
||||
req.on('error', function(err) {
|
||||
authorized();
|
||||
});
|
||||
@@ -52,12 +52,12 @@ function rejectUnauthorized() {
|
||||
}
|
||||
|
||||
function authorized() {
|
||||
var options = {
|
||||
const options = {
|
||||
port: server.address().port,
|
||||
ca: [fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'))]
|
||||
};
|
||||
options.agent = new https.Agent(options);
|
||||
var req = https.request(options, function(res) {
|
||||
const req = https.request(options, function(res) {
|
||||
res.resume();
|
||||
assert(req.socket.authorized);
|
||||
server.close();
|
||||
|
||||
Reference in new issue
Block a user