Disallow multi-assign

This commit is contained in:
Juanjo Diaz 2018-07-14 01:39:32 +02:00
parent b527d65c14
commit 3ab566204d
6 changed files with 17 additions and 8 deletions

View File

@ -329,7 +329,7 @@
// disallow use of chained assignment expressions
// https://eslint.org/docs/rules/no-multi-assign
// "no-multi-assign": ["error"],
"no-multi-assign": ["error"],
// disallow multiple empty lines and only one newline at the end
"no-multiple-empty-lines": ["error", { max: 2, maxEOF: 0 }],

View File

@ -152,7 +152,8 @@ export default function DES(passwd) {
for (let i = 0; i < 16; ++i) {
const m = i << 1;
const n = m + 1;
kn[m] = kn[n] = 0;
kn[m] = 0;
kn[n] = 0;
for (let o = 28; o < 59; o += 28) {
for (let j = o - 28; j < o; ++j) {
const l = j + totrot[i];

View File

@ -300,8 +300,10 @@ export default class Display {
vx, vy, w, h);
}
this._damageBounds.left = this._damageBounds.top = 65535;
this._damageBounds.right = this._damageBounds.bottom = 0;
this._damageBounds.top = 65535;
this._damageBounds.left = 65535;
this._damageBounds.bottom = 0;
this._damageBounds.right = 0;
}
}

View File

@ -24,7 +24,10 @@ export function init_logging(level) {
_log_level = level;
}
Debug = Info = Warn = Error = () => {};
Debug = () => {};
Info = () => {};
Warn = () => {};
Error = () => {};
if (typeof window.console !== 'undefined') {
/* eslint-disable no-console, no-fallthrough */

View File

@ -138,7 +138,8 @@ describe('Display/Canvas Helper', function () {
const expected = [];
for (let i = 0; i < 4 * 2 * 2; i += 4) {
expected[i] = 0xff;
expected[i + 1] = expected[i + 2] = 0;
expected[i + 1] = 0;
expected[i + 2] = 0;
expected[i + 3] = 0xff;
}
expect(display).to.have.displayed(new Uint8Array(expected));
@ -302,7 +303,8 @@ describe('Display/Canvas Helper', function () {
const expected = [];
for (let i = 0; i < 4 * display._fb_width * display._fb_height; i += 4) {
expected[i] = 0xff;
expected[i + 1] = expected[i + 2] = 0;
expected[i + 1] = 0;
expected[i + 2] = 0;
expected[i + 3] = 0xff;
}
expect(display).to.have.displayed(new Uint8Array(expected));

View File

@ -55,7 +55,8 @@ describe('Remote Frame Buffer Protocol Client', function () {
after(FakeWebSocket.restore);
before(function () {
this.clock = clock = sinon.useFakeTimers();
clock = sinon.useFakeTimers();
this.clock = clock;
// sinon doesn't support this yet
raf = window.requestAnimationFrame;
window.requestAnimationFrame = setTimeout;