Alex Crichton 88618116ac
Add support for #[wasm_bindgen] on async fn (#1754)
This commit adds support to attach `#[wasm_bindgen]` on an `async fn`
which will change the return value into a `Promise` in JS. This in
theory has the exact same semantics as an `async` function in JS where
you call it with all the arguments, nothing happens and you get a
promise back, and then later the promise actually resolves.

This commit also adds a helper trait, `IntoJsResult`, to allow `async`
functions with multiple kinds of return values instead of requiring
everything to be `Result<JsValue, JsValue>`.
2019-09-06 13:47:16 -05:00

30 lines
895 B
TOML

[package]
name = "wasm-bindgen-macro"
version = "0.2.50"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
documentation = "https://docs.rs/wasm-bindgen"
description = """
Definition of the `#[wasm_bindgen]` attribute, an internal dependency
"""
edition = "2018"
[lib]
proc-macro = true
[features]
spans = ["wasm-bindgen-macro-support/spans"]
xxx_debug_only_print_generated_code = []
strict-macro = ["wasm-bindgen-macro-support/strict-macro"]
[dependencies]
wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.50" }
quote = "1.0"
[dev-dependencies]
trybuild = "1.0"
wasm-bindgen = { path = "../..", version = "0.2.50", features = ['strict-macro'] }
wasm-bindgen-futures = { path = "../futures", version = "0.4.0" }