forked from AbleOS/holey-bytes
Fixing the invalid code bricking the UI
Signed-off-by: Jakub Doka <jakub.doka2@gmail.com>
This commit is contained in:
parent
5aeeedbdce
commit
91e35b72ee
|
@ -336,10 +336,10 @@ async function fmt(target) {
|
||||||
const instance = await getFmtInstance();
|
const instance = await getFmtInstance();
|
||||||
const decoder = new TextDecoder('utf-8');
|
const decoder = new TextDecoder('utf-8');
|
||||||
const fmt = modifyCode(instance, code, 'fmt');
|
const fmt = modifyCode(instance, code, 'fmt');
|
||||||
if (typeof fmt !== "string") never()
|
if (typeof fmt !== "string") return;
|
||||||
const codeBytes = new TextEncoder().encode(fmt);
|
const codeBytes = new TextEncoder().encode(fmt);
|
||||||
const tok = modifyCode(instance, fmt, 'tok');
|
const tok = modifyCode(instance, fmt, 'tok');
|
||||||
if (!(tok instanceof Uint8Array)) never();
|
if (!(tok instanceof Uint8Array)) return;
|
||||||
target.innerHTML = '';
|
target.innerHTML = '';
|
||||||
let start = 0;
|
let start = 0;
|
||||||
let kind = tok[0];
|
let kind = tok[0];
|
||||||
|
|
Loading…
Reference in a new issue