]> Cypherpunks repositories - gostls13.git/commitdiff
misc/wasm: set non-empty default for os.Args
authorRichard Musiol <mail@richard-musiol.de>
Fri, 8 Jun 2018 16:28:37 +0000 (18:28 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 8 Jun 2018 21:07:22 +0000 (21:07 +0000)
os.Args is usually never empty and the flag package panics if it is.
This commit makes os.Args default to ["js"] for js/wasm.

Change-Id: Iba527145686487b052da438fca40159e57e61a81
Reviewed-on: https://go-review.googlesource.com/117475
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/wasm/wasm_exec.js

index e579ecf677d95013e81115c251241abfa898fea3..151de2e2d16a5519585f259d8693335176de6638 100755 (executable)
@@ -51,7 +51,7 @@
 
        global.Go = class {
                constructor() {
-                       this.argv = [];
+                       this.argv = ["js"];
                        this.env = {};
                        this.exit = (code) => {
                                if (code !== 0) {