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

Function fxModuleGetProperty

xs/sources/xsModule.c:2697–2726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2695}
2696
2697txSlot* fxModuleGetProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag)
2698{
2699 if (id == XS_NO_ID)
2700 return C_NULL;
2701 if (fxIsKeySymbol(the, id)) {
2702 if (id == mxID(_Symbol_toStringTag))
2703 return mxModulePrototype.value.reference->next;
2704 }
2705// if (mxModuleInstanceStatus(instance) < XS_MODULE_STATUS_LINKED) {
2706// return &mxModuleAccessor;
2707// }
2708// else
2709 {
2710 txSlot* exports = mxModuleInstanceExports(instance);
2711 if (mxIsReference(exports)) {
2712 txSlot* property = exports->value.reference->next;
2713 while (property) {
2714 if (property->ID == id) {
2715 property = property->value.export.closure;
2716 if (property && (property->kind == XS_UNINITIALIZED_KIND)) {
2717 return &mxModuleAccessor;
2718 }
2719 return property;
2720 }
2721 property = property->next;
2722 }
2723 }
2724 }
2725 return C_NULL;
2726}
2727
2728txBoolean fxModuleGetPropertyValue(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* receiver, txSlot* value)
2729{

Callers

nothing calls this directly

Calls 1

fxIsKeySymbolFunction · 0.85

Tested by

no test coverage detected