From 59591f8788dac221d0d59baf8709a4ee96ce8525 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 27 Apr 2021 13:15:00 +0200 Subject: [PATCH] Enable the `no-var` rule in the ` src/core/ascii_hex_stream.js` file --- src/core/ascii_hex_stream.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/core/ascii_hex_stream.js b/src/core/ascii_hex_stream.js index 7446672f3..07d1ee6f0 100644 --- a/src/core/ascii_hex_stream.js +++ b/src/core/ascii_hex_stream.js @@ -12,11 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint-disable no-var */ import { DecodeStream } from "./stream.js"; -var AsciiHexStream = (function AsciiHexStreamClosure() { +const AsciiHexStream = (function AsciiHexStreamClosure() { // eslint-disable-next-line no-shadow function AsciiHexStream(str, maybeLength) { this.str = str; @@ -35,21 +34,21 @@ var AsciiHexStream = (function AsciiHexStreamClosure() { AsciiHexStream.prototype = Object.create(DecodeStream.prototype); AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { - var UPSTREAM_BLOCK_SIZE = 8000; - var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); + const UPSTREAM_BLOCK_SIZE = 8000; + const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); if (!bytes.length) { this.eof = true; return; } - var maxDecodeLength = (bytes.length + 1) >> 1; - var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); - var bufferLength = this.bufferLength; + const maxDecodeLength = (bytes.length + 1) >> 1; + const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); + let bufferLength = this.bufferLength; - var firstDigit = this.firstDigit; - for (var i = 0, ii = bytes.length; i < ii; i++) { - var ch = bytes[i], - digit; + let firstDigit = this.firstDigit; + for (let i = 0, ii = bytes.length; i < ii; i++) { + const ch = bytes[i]; + let digit; if (ch >= /* '0' = */ 0x30 && ch <= /* '9' = */ 0x39) { digit = ch & 0x0f; } else if (