mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-17 06:21:36 +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
13 lines
374 B
JavaScript
13 lines
374 B
JavaScript
const rust = import('./fetch');
|
|
|
|
rust
|
|
.then(m => {
|
|
m.run().then((data) => {
|
|
console.log(data);
|
|
|
|
console.log("The latest commit to the wasm-bindgen %s branch is:", data.name);
|
|
console.log("%s, authored by %s <%s>", data.commit.sha, data.commit.commit.author.name, data.commit.commit.author.email);
|
|
})
|
|
})
|
|
.catch(console.error);
|