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

Function fxModuleHasProperty

xs/sources/xsModule.c:2746–2771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2744}
2745
2746txBoolean fxModuleHasProperty(txMachine* the, txSlot* instance, txID id, txIndex index)
2747{
2748 if (id == XS_NO_ID)
2749 return 0;
2750 if (fxIsKeySymbol(the, id)) {
2751 return (id == mxID(_Symbol_toStringTag)) ? 1 : 0;
2752 }
2753// if (mxModuleInstanceStatus(instance) < XS_MODULE_STATUS_LINKED) {
2754// mxReferenceError("module not initialized yet");
2755// }
2756// else
2757 {
2758 txSlot* exports = mxModuleInstanceExports(instance);
2759 if (mxIsReference(exports)) {
2760 txSlot* property = exports->value.reference->next;
2761 while (property) {
2762 if (property->ID == id) {
2763 property = property->value.export.closure;
2764 return property ? 1 : 0;
2765 }
2766 property = property->next;
2767 }
2768 }
2769 }
2770 return 0;
2771}
2772
2773txBoolean fxModuleIsExtensible(txMachine* the, txSlot* instance)
2774{

Callers

nothing calls this directly

Calls 1

fxIsKeySymbolFunction · 0.85

Tested by

no test coverage detected