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

Function fxRunModuleFileInCompartment

xs/tools/xst262.c:1446–1458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1444}
1445
1446void fxRunModuleFileInCompartment(txMachine* the, txString path)
1447{
1448 xsVar(1) = xsNewObject();
1449 fxBuildCompartmentGlobals(the);
1450 xsSet(xsVar(1), xsID("globals"), xsResult);
1451 xsVar(2) = xsNewHostFunction(fxLoadHook, 1);
1452 xsSet(xsVar(1), xsID("loadHook"), xsVar(2));
1453 xsVar(2) = xsNew1(xsGlobal, xsID("Compartment"), xsVar(1));
1454 xsResult = xsCall1(xsVar(2), xsID("import"), xsString(path));
1455 xsVar(3) = xsNewHostFunction(fxFulfillModuleFile, 1);
1456 xsVar(4) = xsNewHostFunction(fxRejectModuleFile, 1);
1457 xsCall2(xsResult, xsID("then"), xsVar(3), xsVar(4));
1458}
1459
1460void fxRunProgramFileInCompartment(txMachine* the, txString path, txUnsigned flags)
1461{

Callers 1

fxRunTestCaseFunction · 0.85

Calls 1

Tested by

no test coverage detected