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

Method preCompile

valdi/src/valdi/standalone_runtime/ValdiStandaloneRuntime.cpp:328–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328Result<Void> ValdiStandaloneRuntime::preCompile(IJavaScriptBridge* jsBridge,
329 const StringBox& inputPath,
330 const StringBox& outputPath,
331 const StringBox& filename) {
332 auto inputFile = DiskUtils::load(Path(inputPath.toStringView()));
333 if (!inputFile) {
334 return inputFile.moveError();
335 }
336
337 auto preCompileResult = preCompile(jsBridge, inputFile.value(), filename);
338
339 if (!preCompileResult) {
340 return preCompileResult.moveError();
341 }
342
343 Path output(outputPath.toStringView());
344
345 DiskUtils::remove(output);
346
347 return DiskUtils::store(output, preCompileResult.value());
348}
349
350Result<BytesView> ValdiStandaloneRuntime::preCompile(IJavaScriptBridge* jsBridge,
351 const BytesView& inputJs,

Callers

nothing calls this directly

Calls 12

loadFunction · 0.85
storeFunction · 0.85
extractErrorMethod · 0.80
toResultMethod · 0.80
asStringViewMethod · 0.80
valueMethod · 0.65
initializeMethod · 0.65
PathClass · 0.50
removeFunction · 0.50
toStringViewMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected