| 141 | } |
| 142 | |
| 143 | void JSPromise::cancel() { |
| 144 | if (!_cancelable) { |
| 145 | return; |
| 146 | } |
| 147 | |
| 148 | auto taskScheduler = _jsValue.getTaskScheduler(); |
| 149 | if (taskScheduler != nullptr) { |
| 150 | taskScheduler->dispatchOnJsThreadAsync( |
| 151 | _jsValue.getContext(), |
| 152 | [self = strongSmallRef(this)](const JavaScriptEntryParameters& jsEntry) { self->doCancel(jsEntry); }); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | bool JSPromise::isCancelable() const { |
| 157 | return _cancelable; |
nothing calls this directly
no test coverage detected