Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit 15e7917

Browse files
author
Jan Krems
committed
style: Use var in classical for loops
1 parent d669dc5 commit 15e7917

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/_inspect.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ const ProtocolClient = (function setupClient() {
106106
}
107107

108108
function encodeFrameHybi17(payload) {
109+
var i;
110+
109111
const dataLength = payload.length;
110112

111113
let singleByteLength;
@@ -114,7 +116,7 @@ const ProtocolClient = (function setupClient() {
114116
singleByteLength = kEightBytePayloadLengthField;
115117
additionalLength = Buffer.alloc(8);
116118
let remaining = dataLength;
117-
for (let i = 0; i < 8; ++i) {
119+
for (i = 0; i < 8; ++i) {
118120
additionalLength[7 - i] = remaining & 0xFF;
119121
remaining >>= 8;
120122
}
@@ -135,7 +137,7 @@ const ProtocolClient = (function setupClient() {
135137

136138
const mask = Buffer.alloc(4);
137139
const masked = Buffer.alloc(dataLength);
138-
for (let i = 0; i < dataLength; ++i) {
140+
for (i = 0; i < dataLength; ++i) {
139141
masked[i] = payload[i] ^ mask[i % kMaskingKeyWidthInBytes];
140142
}
141143

@@ -190,7 +192,7 @@ const ProtocolClient = (function setupClient() {
190192
case kEightBytePayloadLengthField:
191193
payloadOffset += 8;
192194
payloadLength = 0;
193-
for (let i = 0; i < 8; ++i) {
195+
for (var i = 0; i < 8; ++i) {
194196
payloadLength <<= 8;
195197
payloadLength |= data[2 + i];
196198
}

0 commit comments

Comments
 (0)