Fix ESLint warnings (and one actual bug)

This commit is contained in:
Joshua Bell 2023-01-04 19:34:23 -08:00
parent 8efe1058f8
commit 0242c645ca
1 changed files with 7 additions and 5 deletions

View File

@ -421,7 +421,7 @@ async function getSerialPort() {
if (n <= 0) throw new Error();
const result = [];
while (result.length < n) {
const {value, done} = await gen.next();
const {value, done} = await this.gen.next();
if (done) throw new Error('out of data');
result.push(value);
}
@ -463,7 +463,7 @@ async function startStreaming() {
};
while (true) {
for (;;) {
const command = (await port.read(1))[0];
const size = (await port.read(1))[0];
const data = size ? await port.read(size) : [];
@ -491,9 +491,11 @@ async function startStreaming() {
// Screen
case 0x80:
// Send a copy
let copy = new Uint8Array(hires_buffer);
await port.write(copy);
break;
{
let copy = new Uint8Array(hires_buffer);
await port.write(copy);
break;
}
default:
console.warn(`Unexpected protocol command: ${command}`);