mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Rename some files
* Use "legacy" instead of "stable" since `futures 0.1` is quicly becoming "legacy" * Rename "atomics" to "legacy_atomics" to leave room for the libstd-based futures atomics version. * Rename "polyfill" to "wait_async_polyfill" to specify what it's polyfilling.
This commit is contained in:
parent
d590a9e053
commit
c8451d6f3e
@ -160,7 +160,7 @@ fn wait_async(ptr: &AtomicI32, val: i32) -> js_sys::Promise {
|
||||
// If `Atomics.waitAsync` isn't defined (as it isn't defined anywhere today)
|
||||
// then we use our fallback, otherwise we use the native function.
|
||||
if Atomics::get_wait_async().is_undefined() {
|
||||
crate::polyfill::wait_async(ptr, val)
|
||||
crate::wait_async_polyfill::wait_async(ptr, val)
|
||||
} else {
|
||||
let mem = wasm_bindgen::memory().unchecked_into::<js_sys::WebAssembly::Memory>();
|
||||
Atomics::wait_async(&mem.buffer(), ptr as *const AtomicI32 as i32 / 4, val)
|
@ -112,15 +112,15 @@ pub use legacy_js2rust::*;
|
||||
cfg_if! {
|
||||
if #[cfg(target_feature = "atomics")] {
|
||||
/// Contains a thread-safe version of this crate, with Futures 0.1
|
||||
mod atomics;
|
||||
mod legacy_atomics;
|
||||
|
||||
/// Polyfill for `Atomics.waitAsync` function
|
||||
mod polyfill;
|
||||
mod wait_async_polyfill;
|
||||
|
||||
pub use atomics::*;
|
||||
pub use legacy_atomics::*;
|
||||
} else {
|
||||
mod stable;
|
||||
pub use stable::*;
|
||||
mod legacy;
|
||||
pub use legacy::*;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user