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

Method doEvalScript

valdi/src/valdi/standalone_runtime/ValdiStandaloneRuntime.cpp:247–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245
246void ValdiStandaloneRuntime::doEvalScript(const StringBox& scriptPath, const std::vector<StringBox>& jsArguments) {
247 setupJsRuntime(jsArguments);
248
249 auto result = _runtime->getJavaScriptRuntime()->evalModuleSync(scriptPath, _shouldWaitForHotReload);
250 if (!result) {
251 VALDI_ERROR(ConsoleLogger::getLogger(), "{}", result.error());
252 if (!_shouldWaitForHotReload) {
253 _mainQueue->exit(1);
254 }
255 }
256}
257
258void ValdiStandaloneRuntime::waitForHotReloadAndEvalScript(const StringBox& scriptPath,
259 const std::vector<StringBox>& jsArguments) {
260 if (_runtime->getHotReloadSequence() > 0) {

Callers

nothing calls this directly

Calls 4

evalModuleSyncMethod · 0.80
getJavaScriptRuntimeMethod · 0.80
errorMethod · 0.65
exitMethod · 0.65

Tested by

no test coverage detected