| 59 | } |
| 60 | |
| 61 | Value ThenMethodOnFulfilledOnRejectedReject(const CallbackInfo& info) { |
| 62 | auto deferred = Promise::Deferred::New(info.Env()); |
| 63 | Function onFulfilled = info[0].As<Function>(); |
| 64 | Function onRejected = info[1].As<Function>(); |
| 65 | |
| 66 | Promise resultPromise = |
| 67 | MaybeUnwrap(deferred.Promise().Then(onFulfilled, onRejected)); |
| 68 | |
| 69 | bool isPromise = resultPromise.IsPromise(); |
| 70 | deferred.Reject(String::New(info.Env(), "Rejected")); |
| 71 | |
| 72 | Object result = Object::New(info.Env()); |
| 73 | result["isPromise"] = Boolean::New(info.Env(), isPromise); |
| 74 | result["promise"] = resultPromise; |
| 75 | |
| 76 | return result; |
| 77 | } |
| 78 | |
| 79 | Value CatchMethod(const CallbackInfo& info) { |
| 80 | auto deferred = Promise::Deferred::New(info.Env()); |
nothing calls this directly
no test coverage detected