Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Addressed lingering review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jalextowle committed Feb 4, 2020
1 parent 1b64f79 commit 6c98cbd
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions browser/conversion-tests/conversion_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,17 @@ window.addEventListener(loadEventName, () => {
// Start compiling the WebAssembly as soon as the script is loaded. This lets
// us initialize as quickly as possible.
const go = new Go();
fetch('conversion_test.wasm')
.then(wasm => {
WebAssembly.instantiateStreaming(wasm, go.importObject)
.then(module => {
go.run(module.instance);
})
.catch(err => {
// tslint:disable-next-line no-console
console.error('Could not load Wasm');
// tslint:disable-next-line no-console
console.error(err);
// If the Wasm bytecode didn't compile, Mesh won't work. We have no
// choice but to throw an error.
setImmediate(() => {
throw err;
});
});

WebAssembly.instantiateStreaming(fetch('conversion_test.wasm'), go.importObject)
.then(module => {
go.run(module.instance);
})
.catch(err => {
// tslint:disable-next-line no-console
console.error('Could not fetch Wasm');
console.error('Could not load Wasm');
// tslint:disable-next-line no-console
console.error(err);
// If the Wasm bytecode wasn't fetched, Mesh won't work. We have no
// If the Wasm bytecode didn't compile, Mesh won't work. We have no
// choice but to throw an error.
setImmediate(() => {
throw err;
Expand Down

0 comments on commit 6c98cbd

Please sign in to comment.