Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: refactor internal debug variable #40364

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/internal/debugger/inspect_client.js
Expand Up @@ -61,8 +61,6 @@ function validateHandshake(requestKey, responseKey) {
}

function encodeFrameHybi17(payload) {
var i;

const dataLength = payload.length;

let singleByteLength;
Expand All @@ -71,7 +69,7 @@ function encodeFrameHybi17(payload) {
singleByteLength = kEightBytePayloadLengthField;
additionalLength = Buffer.alloc(8);
let remaining = dataLength;
for (i = 0; i < 8; ++i) {
for (let i = 0; i < 8; ++i) {
additionalLength[7 - i] = remaining & 0xFF;
remaining >>= 8;
}
Expand All @@ -92,7 +90,7 @@ function encodeFrameHybi17(payload) {

const mask = Buffer.alloc(4);
const masked = Buffer.alloc(dataLength);
for (i = 0; i < dataLength; ++i) {
for (let i = 0; i < dataLength; ++i) {
masked[i] = payload[i] ^ mask[i % kMaskingKeyWidthInBytes];
}

Expand Down Expand Up @@ -147,7 +145,7 @@ function decodeFrameHybi17(data) {
case kEightBytePayloadLengthField:
payloadOffset += 8;
payloadLength = 0;
for (var i = 0; i < 8; ++i) {
for (let i = 0; i < 8; ++i) {
payloadLength <<= 8;
payloadLength |= data[2 + i];
}
Expand Down