Enable the no-var rule in the src/core/ascii_hex_stream.js file

This commit is contained in:
Jonas Jenwald 2021-04-27 13:15:00 +02:00
parent d63df04854
commit 59591f8788

View File

@ -12,11 +12,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable no-var */
import { DecodeStream } from "./stream.js"; import { DecodeStream } from "./stream.js";
var AsciiHexStream = (function AsciiHexStreamClosure() { const AsciiHexStream = (function AsciiHexStreamClosure() {
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
function AsciiHexStream(str, maybeLength) { function AsciiHexStream(str, maybeLength) {
this.str = str; this.str = str;
@ -35,21 +34,21 @@ var AsciiHexStream = (function AsciiHexStreamClosure() {
AsciiHexStream.prototype = Object.create(DecodeStream.prototype); AsciiHexStream.prototype = Object.create(DecodeStream.prototype);
AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() {
var UPSTREAM_BLOCK_SIZE = 8000; const UPSTREAM_BLOCK_SIZE = 8000;
var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE);
if (!bytes.length) { if (!bytes.length) {
this.eof = true; this.eof = true;
return; return;
} }
var maxDecodeLength = (bytes.length + 1) >> 1; const maxDecodeLength = (bytes.length + 1) >> 1;
var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength);
var bufferLength = this.bufferLength; let bufferLength = this.bufferLength;
var firstDigit = this.firstDigit; let firstDigit = this.firstDigit;
for (var i = 0, ii = bytes.length; i < ii; i++) { for (let i = 0, ii = bytes.length; i < ii; i++) {
var ch = bytes[i], const ch = bytes[i];
digit; let digit;
if (ch >= /* '0' = */ 0x30 && ch <= /* '9' = */ 0x39) { if (ch >= /* '0' = */ 0x30 && ch <= /* '9' = */ 0x39) {
digit = ch & 0x0f; digit = ch & 0x0f;
} else if ( } else if (