mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 05:52:21 +03:00
bc36b6f84b
Some examples have been failing to load in some browsers, and this ensures that whenever the promise to load Rust code fails we log any errors happening instead of accidentally failing silently. This helped debug a bit in #897
7 lines
179 B
JavaScript
7 lines
179 B
JavaScript
// For more comments about what's going on here, check out the `hello_world`
|
|
// example
|
|
const rust = import('./wasm_in_wasm');
|
|
rust
|
|
.then(m => m.run())
|
|
.catch(console.error);
|