init(resolver:)
Creates a new JSPromise
instance from a given resolver
closure. The closure is passed a completion handler. Passing a successful Result
to the completion handler will cause the promise to resolve with the corresponding value; passing a failure Result
will cause the promise to reject with the corresponding value. Calling the completion handler more than once will have no effect (per the JavaScript specification).
convenience init(resolver: @escaping (@escaping (Result) -> Void) -> Void)