Skip to content

Commit 37bebc8

Browse files
authored
Fix bindings and comments for Atomics.wait (#3509)
1 parent 4aae6b3 commit 37bebc8

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
because required arguments occurring after optional arguments are currently not supported by the generator.
3131
[#3480](https://github.com/rustwasm/wasm-bindgen/pull/3480)
3232

33+
### Fixed
34+
35+
* Fixed bindings and comments for `Atomics.wait`.
36+
[#3509](https://github.com/rustwasm/wasm-bindgen/pull/3509)
37+
3338
## [0.2.87](https://github.com/rustwasm/wasm-bindgen/compare/0.2.86...0.2.87)
3439

3540
Released 2023-06-12.

crates/js-sys/src/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1148,32 +1148,32 @@ pub mod Atomics {
11481148
/// Note: This operation only works with a shared `Int32Array`
11491149
/// and may not be allowed on the main thread.
11501150
///
1151-
/// You should use `wait_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`.
1151+
/// You should use `wait_bigint` to operate on a `BigInt64Array`.
11521152
///
11531153
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait)
11541154
#[wasm_bindgen(js_namespace = Atomics, catch)]
11551155
pub fn wait(typed_array: &Int32Array, index: u32, value: i32) -> Result<JsString, JsValue>;
11561156

11571157
/// The static `Atomics.wait()` method verifies that a given
1158-
/// position in an `Int32Array` still contains a given value
1158+
/// position in an `BigInt64Array` still contains a given value
11591159
/// and if so sleeps, awaiting a wakeup or a timeout.
11601160
/// It returns a string which is either "ok", "not-equal", or "timed-out".
1161-
/// Note: This operation only works with a shared `Int32Array`
1161+
/// Note: This operation only works with a shared `BigInt64Array`
11621162
/// and may not be allowed on the main thread.
11631163
///
1164-
/// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`.
1164+
/// You should use `wait` to operate on a `Int32Array`.
11651165
///
11661166
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait)
11671167
#[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)]
11681168
pub fn wait_bigint(
1169-
typed_array: &Int32Array,
1169+
typed_array: &BigInt64Array,
11701170
index: u32,
11711171
value: i64,
11721172
) -> Result<JsString, JsValue>;
11731173

11741174
/// Like `wait()`, but with timeout
11751175
///
1176-
/// You should use `wait_with_timeout_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`.
1176+
/// You should use `wait_with_timeout_bigint` to operate on a `BigInt64Array`.
11771177
///
11781178
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait)
11791179
#[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)]
@@ -1186,12 +1186,12 @@ pub mod Atomics {
11861186

11871187
/// Like `wait()`, but with timeout
11881188
///
1189-
/// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`.
1189+
/// You should use `wait_with_timeout` to operate on a `Int32Array`.
11901190
///
11911191
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait)
11921192
#[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)]
11931193
pub fn wait_with_timeout_bigint(
1194-
typed_array: &Int32Array,
1194+
typed_array: &BigInt64Array,
11951195
index: u32,
11961196
value: i64,
11971197
timeout: f64,

0 commit comments

Comments
 (0)