Function js::jsapi::AddPromiseReactions [] [src]

pub unsafe extern "C" fn AddPromiseReactions(
    cx: *mut JSContext,
    promise: HandleObject,
    onResolve: HandleObject,
    onReject: HandleObject
) -> bool

Unforgeable, optimized version of the JS builtin Promise.prototype.then.

Takes a Promise instance and onResolve, onReject callables to enqueue as reactions for that promise. In difference to Promise.prototype.then, this doesn't create and return a new Promise instance.

Asserts if the passed-in promise object isn't an unwrapped instance of Promise or a subclass or onResolve and onReject aren't both callable objects.