mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-15 14:01:25 +00:00
js-sys: Promise methods should take JS things by shared reference
This commit is contained in:
@ -54,7 +54,7 @@
|
|||||||
//! pub fn new() -> NextTick {
|
//! pub fn new() -> NextTick {
|
||||||
//! // Create a resolved promise that will run its callbacks on the next
|
//! // Create a resolved promise that will run its callbacks on the next
|
||||||
//! // tick of the micro task queue.
|
//! // tick of the micro task queue.
|
||||||
//! let promise = js_sys::Promise::resolve(JsValue::NULL);
|
//! let promise = js_sys::Promise::resolve(&JsValue::NULL);
|
||||||
//! // Convert the promise into a `JsFuture`.
|
//! // Convert the promise into a `JsFuture`.
|
||||||
//! let inner = JsFuture::from(promise);
|
//! let inner = JsFuture::from(promise);
|
||||||
//! NextTick { inner }
|
//! NextTick { inner }
|
||||||
|
@ -3109,7 +3109,7 @@ extern {
|
|||||||
///
|
///
|
||||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
|
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
|
||||||
#[wasm_bindgen(static_method_of = Promise)]
|
#[wasm_bindgen(static_method_of = Promise)]
|
||||||
pub fn all(obj: JsValue) -> Promise;
|
pub fn all(obj: &JsValue) -> Promise;
|
||||||
|
|
||||||
/// The `Promise.race(iterable)` method returns a promise that resolves or
|
/// The `Promise.race(iterable)` method returns a promise that resolves or
|
||||||
/// rejects as soon as one of the promises in the iterable resolves or
|
/// rejects as soon as one of the promises in the iterable resolves or
|
||||||
@ -3117,14 +3117,14 @@ extern {
|
|||||||
///
|
///
|
||||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race
|
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race
|
||||||
#[wasm_bindgen(static_method_of = Promise)]
|
#[wasm_bindgen(static_method_of = Promise)]
|
||||||
pub fn race(obj: JsValue) -> Promise;
|
pub fn race(obj: &JsValue) -> Promise;
|
||||||
|
|
||||||
/// The `Promise.reject(reason)` method returns a `Promise` object that is
|
/// The `Promise.reject(reason)` method returns a `Promise` object that is
|
||||||
/// rejected with the given reason.
|
/// rejected with the given reason.
|
||||||
///
|
///
|
||||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject
|
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject
|
||||||
#[wasm_bindgen(static_method_of = Promise)]
|
#[wasm_bindgen(static_method_of = Promise)]
|
||||||
pub fn reject(obj: JsValue) -> Promise;
|
pub fn reject(obj: &JsValue) -> Promise;
|
||||||
|
|
||||||
/// The `Promise.resolve(value)` method returns a `Promise` object that is
|
/// The `Promise.resolve(value)` method returns a `Promise` object that is
|
||||||
/// resolved with the given value. If the value is a promise, that promise
|
/// resolved with the given value. If the value is a promise, that promise
|
||||||
@ -3134,7 +3134,7 @@ extern {
|
|||||||
///
|
///
|
||||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve
|
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve
|
||||||
#[wasm_bindgen(static_method_of = Promise)]
|
#[wasm_bindgen(static_method_of = Promise)]
|
||||||
pub fn resolve(obj: JsValue) -> Promise;
|
pub fn resolve(obj: &JsValue) -> Promise;
|
||||||
|
|
||||||
/// The `catch()` method returns a `Promise` and deals with rejected cases
|
/// The `catch()` method returns a `Promise` and deals with rejected cases
|
||||||
/// only. It behaves the same as calling `Promise.prototype.then(undefined,
|
/// only. It behaves the same as calling `Promise.prototype.then(undefined,
|
||||||
|
Reference in New Issue
Block a user