]> Cypherpunks repositories - gostls13.git/commitdiff
misc/wasm: add stub for fs.openSync for browsers
authorRichard Musiol <mail@richard-musiol.de>
Thu, 14 Jun 2018 22:08:26 +0000 (00:08 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 15 Jun 2018 00:04:15 +0000 (00:04 +0000)
This stub is necessary so the time package can fail to load
the timezone files in a nice way. It transitively makes the
log package work in browsers.

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

index ada6f0cd9281f0637e3b7acdce0684965d8cf72b..e0759a7ce1bfa05c05cc983be14b3df4b35eebf5 100755 (executable)
                                }
                                return buf.length;
                        },
+                       openSync(path, flags, mode) {
+                               const err = new Error("not implemented");
+                               err.code = "ENOSYS";
+                               throw err;
+                       },
                };
        }