mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-23 09:41:33 +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:
@ -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)
|
// If `Atomics.waitAsync` isn't defined (as it isn't defined anywhere today)
|
||||||
// then we use our fallback, otherwise we use the native function.
|
// then we use our fallback, otherwise we use the native function.
|
||||||
if Atomics::get_wait_async().is_undefined() {
|
if Atomics::get_wait_async().is_undefined() {
|
||||||
crate::polyfill::wait_async(ptr, val)
|
crate::wait_async_polyfill::wait_async(ptr, val)
|
||||||
} else {
|
} else {
|
||||||
let mem = wasm_bindgen::memory().unchecked_into::<js_sys::WebAssembly::Memory>();
|
let mem = wasm_bindgen::memory().unchecked_into::<js_sys::WebAssembly::Memory>();
|
||||||
Atomics::wait_async(&mem.buffer(), ptr as *const AtomicI32 as i32 / 4, val)
|
Atomics::wait_async(&mem.buffer(), ptr as *const AtomicI32 as i32 / 4, val)
|
@ -112,15 +112,15 @@ pub use legacy_js2rust::*;
|
|||||||
cfg_if! {
|
cfg_if! {
|
||||||
if #[cfg(target_feature = "atomics")] {
|
if #[cfg(target_feature = "atomics")] {
|
||||||
/// Contains a thread-safe version of this crate, with Futures 0.1
|
/// Contains a thread-safe version of this crate, with Futures 0.1
|
||||||
mod atomics;
|
mod legacy_atomics;
|
||||||
|
|
||||||
/// Polyfill for `Atomics.waitAsync` function
|
/// Polyfill for `Atomics.waitAsync` function
|
||||||
mod polyfill;
|
mod wait_async_polyfill;
|
||||||
|
|
||||||
pub use atomics::*;
|
pub use legacy_atomics::*;
|
||||||
} else {
|
} else {
|
||||||
mod stable;
|
mod legacy;
|
||||||
pub use stable::*;
|
pub use legacy::*;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user