MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fx_runScript

Function fx_runScript

xs/tools/xst.c:550–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550void fx_runScript(xsMachine* the)
551{
552 txSlot* realm = mxProgram.value.reference->next->value.module.realm;
553 char path[C_PATH_MAX];
554 txUnsigned flags = mxProgramFlag | mxDebugFlag;
555 if (!c_realpath(fxToString(the, mxArgv(0)), path))
556 xsURIError("file not found");
557 txScript* script = fxLoadScript(the, path, flags);
558 mxModuleInstanceInternal(mxProgram.value.reference)->value.module.id = fxID(the, path);
559 fxRunScript(the, script, mxRealmGlobal(realm), C_NULL, mxRealmClosures(realm)->value.reference, C_NULL, mxProgram.value.reference);
560 mxPullSlot(mxResult);
561}
562
563/* $262 */
564

Callers

nothing calls this directly

Calls 5

c_realpathFunction · 0.85
fxToStringFunction · 0.85
fxIDFunction · 0.85
fxRunScriptFunction · 0.85
fxLoadScriptFunction · 0.70

Tested by

no test coverage detected