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

Method onComplete

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

Source from the content-addressed store, hash-verified

131JSPromise::~JSPromise() = default;
132
133void 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
143void JSPromise::cancel() {
144 if (!_cancelable) {

Callers

nothing calls this directly

Calls 5

doOnCompleteMethod · 0.95
strongSmallRefFunction · 0.85
getTaskSchedulerMethod · 0.45
getContextMethod · 0.45

Tested by

no test coverage detected