Contents

init(newPromiseRejectedWithReason:in:)

Creates a rejected promise object with the specified value.

Declaration

init!(newPromiseRejectedWithReason reason: Any!, in context: JSContext!)

Parameters

  • reason:

    The result value to pass to any reactions.

  • context:

    The Jscontext the resulting Jsvalue belongs to.

Return Value

A JSValue that represents a new promise JavaScript object.

Discussion

This method is equivalent to calling the following:

[JSValue valueWithNewPromiseFromExecutor:^(JSValue *resolve, JSValue *reject) { 
    [reject callWithArguments:@[reason]]; 
} inContext:context];

See Also

Creating JavaScript Values