This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checksum calculations were failing in Edge because the Rust WebAssembly wrapper depends on `TextDecoder`, which is not supported by the current version of Edge (even though WebAssembly itself is supported): https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/TextDecoder This commit fixes the problem by trying to load the WASM module, and falling back to checksums calculated in JavaScript if the module fails to load. This uses exceptions for control flow, but there's no obvious property to test to be confident that WASM will work, since it may depend on modules other than `TextDecoder` in the future. A possible alternative would be to polyfill `TextDecoder`, as described here: golang/go#27295 (comment) The polyfill is quite complicated, though, so the JS checksum fallback seems like a better solution, at least for now. We can revisit it if there are major performance problems.
- Loading branch information
1 parent
0cdfc61
commit 755e080
Showing
4 changed files
with
67 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters