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

Function fxFindRealm

xs/sources/xsDebug.c:2312–2329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2310}
2311
2312txSlot* fxFindRealm(txMachine* the)
2313{
2314 txSlot* frame = fxFindFrame(the);
2315 txSlot* realm = C_NULL;
2316 if (frame && (!(frame->flag & XS_C_FLAG))) {
2317 txSlot* function = frame + 2;
2318 if (mxIsReference(function)) {
2319 txSlot* instance = function->value.reference;
2320 txSlot* home = mxFunctionInstanceHome(instance);
2321 txSlot* module = home->value.home.module;
2322 if (module)
2323 realm = mxModuleInstanceInternal(module)->value.module.realm;
2324 }
2325 }
2326 if (!realm)
2327 realm = mxModuleInstanceInternal(mxProgram.value.reference)->value.module.realm;
2328 return realm;
2329}
2330
2331void fxGo(txMachine* the)
2332{

Callers 2

fxListGlobalFunction · 0.85
fxListModulesFunction · 0.85

Calls 1

fxFindFrameFunction · 0.85

Tested by

no test coverage detected