mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
cmd/gogio: fix support for older browsers
That change removes the "??" operator, it isn't supported by old browsers [0]. [0]: https://caniuse.com/mdn-javascript_operators_nullish_coalescing Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
@@ -135,7 +135,10 @@ const (
|
|||||||
// jsSetGo sets the `window.go` variable.
|
// jsSetGo sets the `window.go` variable.
|
||||||
jsSetGo = `(() => {
|
jsSetGo = `(() => {
|
||||||
window.go = {argv: [], env: {}, importObject: {go: {}}};
|
window.go = {argv: [], env: {}, importObject: {go: {}}};
|
||||||
window.go["argv"] = (new URLSearchParams(location.search).get("argv") ?? "").split(" ");
|
const argv = new URLSearchParams(location.search).get("argv");
|
||||||
|
if (argv) {
|
||||||
|
window.go["argv"] = argv.split(" ");
|
||||||
|
}
|
||||||
})();`
|
})();`
|
||||||
// jsStartGo initializes the main.wasm.
|
// jsStartGo initializes the main.wasm.
|
||||||
jsStartGo = `(() => {
|
jsStartGo = `(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user