mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-21 20:22:14 +00:00
This commit defaults all crates in-tree to use `std::future` by default and none of them support the crates.io `futures` 0.1 crate any more. This is a breaking change for `wasm-bindgen-futures` and `wasm-bindgen-test` so they've both received a major version bump to reflect the new defaults. Historical versions of these crates should continue to work if necessary, but they won't receive any more maintenance after this is merged. The movement here liberally uses `async`/`await` to remove the need for using any combinators on the `Future` trait. As a result many of the crates now rely on a much more recent version of the compiler, especially to run tests. The `wasm-bindgen-futures` crate was updated to remove all of its futures-related dependencies and purely use `std::future`, hopefully improving its compatibility by not having any version compat considerations over time. The implementations of the executors here are relatively simple and only delve slightly into the `RawWaker` business since there are no other stable APIs in `std::task` for wrapping these. This commit also adds support for: #[wasm_bindgen_test] async fn foo() { // ... } where previously you needed to pass `(async)` now that's inferred because it's an `async fn`. Closes #1558 Closes #1695
64 lines
1.5 KiB
Rust
64 lines
1.5 KiB
Rust
#![cfg(target_arch = "wasm32")]
|
|
|
|
use wasm_bindgen_test::*;
|
|
|
|
wasm_bindgen_test_configure!(run_in_browser);
|
|
|
|
pub mod anchor_element;
|
|
pub mod body_element;
|
|
pub mod br_element;
|
|
pub mod button_element;
|
|
pub mod console;
|
|
pub mod div_element;
|
|
pub mod element;
|
|
pub mod event;
|
|
pub mod head_element;
|
|
pub mod headers;
|
|
pub mod heading_element;
|
|
pub mod history;
|
|
pub mod hr_element;
|
|
pub mod html_element;
|
|
pub mod html_html_element;
|
|
pub mod input_element;
|
|
//TODO: Both menu-related tests completely break in Chrome, but run fine in Firefox.
|
|
//pub mod menu_element;
|
|
//pub mod menu_item_element;
|
|
pub mod dom_point;
|
|
pub mod indexeddb;
|
|
pub mod location;
|
|
pub mod meta_element;
|
|
pub mod meter_element;
|
|
pub mod mod_elements;
|
|
pub mod olist_element;
|
|
pub mod optgroup_element;
|
|
pub mod option_element;
|
|
pub mod options_collection;
|
|
pub mod output_element;
|
|
pub mod paragraph_element;
|
|
pub mod param_element;
|
|
pub mod performance;
|
|
pub mod pre_element;
|
|
pub mod progress_element;
|
|
pub mod quote_element;
|
|
pub mod response;
|
|
pub mod rtc_rtp_transceiver_direction;
|
|
pub mod script_element;
|
|
pub mod select_element;
|
|
pub mod slot_element;
|
|
pub mod span_element;
|
|
pub mod style_element;
|
|
pub mod table_element;
|
|
pub mod title_element;
|
|
pub mod whitelisted_immutable_slices;
|
|
pub mod xpath_result;
|
|
|
|
#[wasm_bindgen_test]
|
|
fn deref_works() {
|
|
fn _check(a: &web_sys::XmlHttpRequestUpload) {
|
|
let _x: &web_sys::XmlHttpRequestEventTarget = a;
|
|
let _x: &web_sys::EventTarget = a;
|
|
let _x: &js_sys::Object = a;
|
|
let _x: &wasm_bindgen::JsValue = a;
|
|
}
|
|
}
|