webstead: enable strict mode in top-level script

Now that it's not a module, we need to do this explicitly.  Also fix
various undeclared variables that this exposed.
This commit is contained in:
Ben Harris 2025-10-12 00:53:01 +01:00
parent 96f2490058
commit d99c68a2ba

View File

@ -43,6 +43,7 @@
https://issues.chromium.org/issues/40518469
And it's not a module because Safari can't handle that. -->
<script async="async"><![CDATA[
"use strict";
var Bedstead;
function update_glyph(c_update_needed) {
var args = [];
@ -74,12 +75,12 @@
});
}
function from_c(c) {
re = /[0-7]+/g;
var re = /[0-7]+/g;
document.querySelector('#inpane').reset();
for (row of document.querySelector('#pixels').rows) {
match = re.exec(c);
for (var row of document.querySelector('#pixels').rows) {
var match = re.exec(c);
if (match == null) break;
rowbits = Number.parseInt(match[0], 8);
var rowbits = Number.parseInt(match[0], 8);
for (var pixel
of Array.from(row.querySelectorAll('input')).reverse()) {
pixel.checked = (rowbits & 1 != 0);