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

Function fxRunImportMeta

xs/sources/xsModule.c:2381–2409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2379/* META */
2380
2381void fxRunImportMeta(txMachine* the, txSlot* module)
2382{
2383 txSlot* meta = mxModuleInstanceMeta(module);
2384 if (mxIsNull(meta)) {
2385 fxNewInstance(the);
2386 mxPullSlot(meta);
2387#if mxModuleStuff
2388 {
2389 txSlot* reference = mxModuleInstanceHook(module);
2390 if (mxIsReference(reference)) {
2391 txSlot* handler = mxModuleStuffHandler(reference);
2392 txSlot* importMetaHook = mxModuleStuffImportMetaHook(reference);
2393 if (mxIsReference(handler) && mxIsReference(importMetaHook)) {
2394 fxBeginHost(the);
2395 mxPushSlot(handler);
2396 mxPushSlot(importMetaHook);
2397 mxCall();
2398 mxPushSlot(meta);
2399 mxRunCount(1);
2400 mxPop();
2401 fxEndHost(the);
2402 }
2403 }
2404 }
2405#endif
2406 meta->value.reference->flag |= XS_DONT_PATCH_FLAG;
2407 }
2408 mxPushSlot(meta);
2409}
2410
2411/* NOW */
2412

Callers 1

xsRun.cFile · 0.85

Calls 3

fxNewInstanceFunction · 0.85
fxBeginHostFunction · 0.85
fxEndHostFunction · 0.85

Tested by

no test coverage detected