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

Method dispatchOnJsThread

valdi/src/valdi/runtime/JavaScript/JavaScriptRuntime.cpp:3674–3696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3672 if (!jsEntry.exceptionTracker) {
3673 result = jsEntry.exceptionTracker.extractError();
3674 return;
3675 }
3676
3677 result = convertedValue;
3678 });
3679
3680 return result;
3681}
3682
3683Result<Void> JavaScriptRuntime::evalModuleSync(const StringBox& path, bool reevalOnReload) {
3684 auto resourceIdResult = JavaScriptPathResolver::resolveResourceId(path);
3685 if (!resourceIdResult) {
3686 return resourceIdResult.moveError();
3687 }
3688
3689 Result<Void> result = Void();
3690
3691 dispatchSynchronouslyOnJsThread(JsThreadDispatchReason::EvalModuleSync, [&](JavaScriptEntryParameters& jsEntry) {
3692 if (reevalOnReload) {
3693 _modulesToAutoReload.insert(resourceIdResult.value());
3694 }
3695
3696 auto importResult = this->importModule(resourceIdResult.value(), jsEntry);
3697 if (!jsEntry.exceptionTracker) {
3698 if (reevalOnReload) {
3699 onRecoverableError("evalModuleSync", jsEntry.exceptionTracker);

Callers 10

callOnJsThreadMethod · 0.45
postInitMethod · 0.45
setHostOnMessageMethod · 0.45
postMessageMethod · 0.45
closeMethod · 0.45
onCreateMethod · 0.45
onDestroyMethod · 0.45
onViewModelUpdateMethod · 0.45
onAttributeChangeMethod · 0.45
onRuntimeIssueMethod · 0.45

Calls 5

RefInterface · 0.50
asyncAfterMethod · 0.45
isCurrentMethod · 0.45
syncMethod · 0.45
asyncMethod · 0.45

Tested by

no test coverage detected