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:
Inkeliz
2020-12-14 08:11:20 +00:00
committed by Elias Naur
parent 296303210f
commit fe844cc489
+4 -1
View File
@@ -135,7 +135,10 @@ const (
// jsSetGo sets the `window.go` variable.
jsSetGo = `(() => {
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 = `(() => {