MCPcopy Create free account
hub / github.com/Snapchat/Valdi / cancel

Method cancel

valdi/src/valdi/runtime/JavaScript/JSPromise.cpp:143–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void 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
156bool JSPromise::isCancelable() const {
157 return _cancelable;

Callers

nothing calls this directly

Calls 5

doCancelMethod · 0.95
strongSmallRefFunction · 0.85
getTaskSchedulerMethod · 0.45
getContextMethod · 0.45

Tested by

no test coverage detected