| 326 | } |
| 327 | |
| 328 | Result<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 | |
| 350 | Result<BytesView> ValdiStandaloneRuntime::preCompile(IJavaScriptBridge* jsBridge, |
| 351 | const BytesView& inputJs, |
nothing calls this directly
no test coverage detected