misc/wasm: add stub for fs.openSync for browsers

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>
This commit is contained in:
Richard Musiol 2018-06-15 00:08:26 +02:00 committed by Brad Fitzpatrick
parent 30b045d4d1
commit adf72bbc9a

View file

@ -41,6 +41,11 @@
}
return buf.length;
},
openSync(path, flags, mode) {
const err = new Error("not implemented");
err.code = "ENOSYS";
throw err;
},
};
}