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

Method createWorker

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

Source from the content-addressed store, hash-verified

3323 onRecoverableError("getModule", jsEntry.exceptionTracker);
3324 return;
3325 }
3326
3327 importResult->addUnloadObserver(observer);
3328 });
3329}
3330
3331void JavaScriptRuntime::preloadModule(const StringBox& path, int32_t maxDepth) {
3332 dispatchOnJsThreadAsync(nullptr, [=](JavaScriptEntryParameters& jsEntry) {
3333 VALDI_TRACE_META("Valdi.preloadModule", path);
3334
3335 std::initializer_list<JSValueRef> params = {
3336 jsEntry.jsContext.newStringUTF8(path.toStringView(), jsEntry.exceptionTracker),
3337 jsEntry.jsContext.newNumber(maxDepth)};
3338
3339 if (!jsEntry.exceptionTracker) {
3340 return;
3341 }
3342
3343 JSFunctionCallContext callContext(jsEntry.jsContext, params.begin(), params.size(), jsEntry.exceptionTracker);
3344
3345 jsEntry.jsContext.callObjectProperty(
3346 _moduleLoader.get(), _propertyNameIndex.getJsName(kPreloadModulePropertyName), callContext);
3347 });
3348}
3349

Callers

nothing calls this directly

Calls 6

weakRefFunction · 0.85
getInnerSharedPtrMethod · 0.80
getMethod · 0.65
postInitMethod · 0.45
registerTypeConverterMethod · 0.45

Tested by

no test coverage detected