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

Function fxCheckModuleFlag

xs/sources/xsModule.c:238–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238void fxCheckModuleFlag(txMachine* the, txID moduleID, txFlag moduleFlag, txFlag requestFlag)
239{
240#ifndef mxLink
241 if (moduleFlag & XS_JSON_MODULE_FLAG) {
242 if (!(requestFlag & XS_JSON_MODULE_FLAG)) {
243 fxIDToString(the, moduleID, the->nameBuffer, sizeof(the->nameBuffer));
244 fxThrowMessage(the, C_NULL, 0, XS_TYPE_ERROR, "%s: JSON module", the->nameBuffer);
245 }
246 }
247 else {
248 if (requestFlag & XS_JSON_MODULE_FLAG) {
249 fxIDToString(the, moduleID, the->nameBuffer, sizeof(the->nameBuffer));
250 fxThrowMessage(the, C_NULL, 0, XS_TYPE_ERROR, "%s: not a JSON module", the->nameBuffer);
251 }
252 }
253#endif
254}
255
256void fxPushModuleOptions(txMachine* the, txFlag moduleFlag)
257{

Callers 2

fxGetModuleFunction · 0.85
fxPrepareModuleFunction · 0.85

Calls 2

fxIDToStringFunction · 0.85
fxThrowMessageFunction · 0.85

Tested by

no test coverage detected