| 206 | } |
| 207 | |
| 208 | void JSPromise::doCancel(const JavaScriptEntryParameters& jsEntry) { |
| 209 | auto jsValue = _jsValue.getJsValue(jsEntry.jsContext, jsEntry.exceptionTracker); |
| 210 | if (!jsEntry.exceptionTracker) { |
| 211 | return; |
| 212 | } |
| 213 | |
| 214 | auto cancelCallback = JSPromiseCancel::getFromJSPromise(jsEntry.jsContext, jsValue, jsEntry.exceptionTracker); |
| 215 | |
| 216 | if (!jsEntry.exceptionTracker || jsEntry.jsContext.isValueUndefined(cancelCallback.get())) { |
| 217 | return; |
| 218 | } |
| 219 | |
| 220 | JSFunctionCallContext callContext(jsEntry.jsContext, nullptr, 0, jsEntry.exceptionTracker); |
| 221 | callContext.setThisValue(jsValue); |
| 222 | |
| 223 | jsEntry.jsContext.callObjectAsFunction(cancelCallback.get(), callContext); |
| 224 | } |
| 225 | |
| 226 | } // namespace Valdi |
no test coverage detected