Commit Graph

2 Commits

Author SHA1 Message Date
Rodrigo Rivas Costa
6b3d730a53
Implement extern "C" async functions. (#2196)
* Implement extern "C" async functions.

It converts a JS Promise into a wasm_bindgen_futures::JsFuture that
implements Future<Result<JsValue, JsValue>>.

* Run rustfmt.

Add #[rustfmt::skip] to the tests/wasm/futures.rs because it removes
the async from extern "C" blocks.
2020-06-29 11:18:47 -05:00
Alex Crichton
9c330529f2
Fix codegen for descriptors of async fn returns (#1782)
They erroneously reported returning the original return type, not the
promise! Let's also add a bunch of positive tests while we're at it.

Closes #1781
2019-09-20 16:06:27 -05:00