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

Method preloadModules

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

Source from the content-addressed store, hash-verified

3274 }
3275
3276 auto& jsContext = *_javaScriptContext;
3277 _symbolicating = true;
3278
3279 JSExceptionTracker exceptionTracker(jsContext);
3280 if (_symbolicateFunction.empty()) {
3281 JavaScriptEntryParameters jsEntry(jsContext, exceptionTracker, nullptr);
3282 auto module = exceptionTracker.toResult(importModule(symbolicatorResourceId(), jsEntry));
3283 if (module) {
3284 auto jsValue = module.value()->getJsValue(jsContext, exceptionTracker);
3285 if (exceptionTracker) {
3286 _symbolicateFunction = exceptionTracker.toRetainedResult(
3287 jsContext.getObjectProperty(jsValue, "symbolicate", jsEntry.exceptionTracker));
3288 } else {
3289 _symbolicateFunction = exceptionTracker.toResult(JSValueRef::makeUnretained(jsContext, jsValue));
3290 }
3291 } else {
3292 _symbolicateFunction = module.moveError();
3293 }
3294
3295 if (!_symbolicateFunction) {
3296 onRecoverableError("symbolicateError", _symbolicateFunction.error());
3297 }
3298 }
3299
3300 if (_symbolicateFunction.success()) {
3301 JSFunctionCallContext callContext(jsContext, &error, 1, exceptionTracker);

Callers

nothing calls this directly

Calls 9

warmUpBundlesMethod · 0.80
newNumberMethod · 0.80
callObjectPropertyMethod · 0.80
getMethod · 0.65
newArrayWithValuesMethod · 0.45
sizeMethod · 0.45
newStringUTF8Method · 0.45
toStringViewMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected