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

Function fx_evalScript

xs/tools/xst.c:460–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460void fx_evalScript(xsMachine* the)
461{
462 txSlot* realm;
463 txSlot* module = mxFunctionInstanceHome(mxFunction->value.reference)->value.home.module;
464 if (!module) module = mxProgram.value.reference;
465 realm = mxModuleInstanceInternal(module)->value.module.realm;
466 txStringStream aStream;
467 aStream.slot = mxArgv(0);
468 aStream.offset = 0;
469 aStream.size = mxStringLength(fxToString(the, mxArgv(0)));
470 fxRunScript(the, fxParseScript(the, &aStream, fxStringGetter, mxProgramFlag | mxDebugFlag), mxRealmGlobal(realm), C_NULL, mxRealmClosures(realm)->value.reference, C_NULL, module);
471 mxPullSlot(mxResult);
472}
473
474void fx_gc(xsMachine* the)
475{

Callers

nothing calls this directly

Calls 3

fxToStringFunction · 0.85
fxRunScriptFunction · 0.85
fxParseScriptFunction · 0.70

Tested by

no test coverage detected