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:
Alex Crichton 2019-07-18 14:00:45 -07:00
parent d590a9e053
commit c8451d6f3e
4 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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::*;
}
}