| 1444 | } |
| 1445 | |
| 1446 | void 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 | |
| 1460 | void fxRunProgramFileInCompartment(txMachine* the, txString path, txUnsigned flags) |
| 1461 | { |
no test coverage detected