| 131 | JSPromise::~JSPromise() = default; |
| 132 | |
| 133 | void JSPromise::onComplete(const Ref<PromiseCallback>& callback) { |
| 134 | auto taskScheduler = _jsValue.getTaskScheduler(); |
| 135 | if (taskScheduler != nullptr) { |
| 136 | taskScheduler->dispatchOnJsThreadAsync( |
| 137 | _jsValue.getContext(), [self = strongSmallRef(this), callback](const JavaScriptEntryParameters& jsEntry) { |
| 138 | self->doOnComplete(callback, jsEntry); |
| 139 | }); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | void JSPromise::cancel() { |
| 144 | if (!_cancelable) { |
nothing calls this directly
no test coverage detected