Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 168020e

Browse filesBrowse files
gdccwxxtargos
authored andcommitted
lib: refactor to use let
move variable into each for loop PR-URL: #40364 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 641b1bb commit 168020e
Copy full SHA for 168020e

File tree

Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Open diff view settings
Collapse file

‎lib/internal/debugger/inspect_client.js‎

Copy file name to clipboardExpand all lines: lib/internal/debugger/inspect_client.js
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ function validateHandshake(requestKey, responseKey) {
6161
}
6262

6363
function encodeFrameHybi17(payload) {
64-
var i;
65-
6664
const dataLength = payload.length;
6765

6866
let singleByteLength;
@@ -71,7 +69,7 @@ function encodeFrameHybi17(payload) {
7169
singleByteLength = kEightBytePayloadLengthField;
7270
additionalLength = Buffer.alloc(8);
7371
let remaining = dataLength;
74-
for (i = 0; i < 8; ++i) {
72+
for (let i = 0; i < 8; ++i) {
7573
additionalLength[7 - i] = remaining & 0xFF;
7674
remaining >>= 8;
7775
}
@@ -92,7 +90,7 @@ function encodeFrameHybi17(payload) {
9290

9391
const mask = Buffer.alloc(4);
9492
const masked = Buffer.alloc(dataLength);
95-
for (i = 0; i < dataLength; ++i) {
93+
for (let i = 0; i < dataLength; ++i) {
9694
masked[i] = payload[i] ^ mask[i % kMaskingKeyWidthInBytes];
9795
}
9896

@@ -147,7 +145,7 @@ function decodeFrameHybi17(data) {
147145
case kEightBytePayloadLengthField:
148146
payloadOffset += 8;
149147
payloadLength = 0;
150-
for (var i = 0; i < 8; ++i) {
148+
for (let i = 0; i < 8; ++i) {
151149
payloadLength <<= 8;
152150
payloadLength |= data[2 + i];
153151
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.