| 34 | } |
| 35 | |
| 36 | void JSPromiseCancel::attachToJSPromise(IJavaScriptContext& jsContext, |
| 37 | const JSValue& jsPromise, |
| 38 | const Ref<Promise>& nativePromise, |
| 39 | JSExceptionTracker& exceptionTracker) { |
| 40 | auto cancelFunction = jsContext.newFunction(makeShared<JSPromiseCancel>(nativePromise), exceptionTracker); |
| 41 | if (!exceptionTracker) { |
| 42 | return; |
| 43 | } |
| 44 | |
| 45 | jsContext.setObjectProperty(jsPromise, getCancelPropertyKey(jsContext), cancelFunction.get(), exceptionTracker); |
| 46 | } |
| 47 | |
| 48 | JSValueRef JSPromiseCancel::getFromJSPromise(IJavaScriptContext& jsContext, |
| 49 | const JSValue& jsPromise, |
nothing calls this directly
no test coverage detected