| 141 | _cancelable(JSPromiseCancel::isJSPromiseCancelable(jsContext, jsValue)) { |
| 142 | // onComplete() runs a task later, after the engine has already flushed its rejection tracker. |
| 143 | jsContext.markPromiseRejectionHandled(jsValue); |
| 144 | } |
| 145 | |
| 146 | JSPromise::~JSPromise() = default; |
| 147 | |
| 148 | void JSPromise::onComplete(const Ref<PromiseCallback>& callback) { |
| 149 | auto taskScheduler = _jsValue.getTaskScheduler(); |
| 150 | if (taskScheduler != nullptr) { |
| 151 | taskScheduler->dispatchOnJsThreadAsync( |
| 152 | _jsValue.getContext(), [self = strongSmallRef(this), callback](const JavaScriptEntryParameters& jsEntry) { |
| 153 | self->doOnComplete(callback, jsEntry); |
| 154 | }); |
| 155 | } |
| 156 | } |
| 157 |
nothing calls this directly
no test coverage detected