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

Function fxEchoPropertyInstance

xs/sources/xsDebug.c:2066–2154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2064
2065
2066void fxEchoPropertyInstance(txMachine* the, txInspectorNameList* theList, txString thePrefix, txIndex theIndex, txString theSuffix, txID theID, txFlag theFlag, txSlot* theInstance)
2067{
2068 txSlot* instanceInspector = fxToInstanceInspector(the, theInstance);
2069 char buffer[128];
2070 txString p = buffer;
2071 txString q = p + sizeof(buffer);
2072
2073 if (theFlag & XS_GETTER_FLAG) {
2074 c_strcpy(p, "get ");
2075 p += 4;
2076 }
2077 else if (theFlag & XS_SETTER_FLAG) {
2078 c_strcpy(p, "set ");
2079 p += 4;
2080 }
2081 if (thePrefix) {
2082 c_strcpy(p, thePrefix);
2083 p += mxStringLength(thePrefix);
2084 if (theSuffix) {
2085 fxIndexToString(the, theIndex, p, mxPtrDiff(q - p - 1)); // assume mxStringLength(theSuffix) == 1;
2086 c_strcat(p, theSuffix);
2087 }
2088 }
2089 else
2090 fxIDToString(the, theID, p, mxPtrDiff(q - p));
2091
2092 fxEcho(the, "<property");
2093 if (instanceInspector) {
2094 if (instanceInspector->value.instanceInspector.link)
2095 fxEchoFlags(the, " ", theFlag);
2096 else
2097 fxEchoFlags(the, "-", theFlag);
2098 }
2099 else
2100 fxEchoFlags(the, "+", theFlag);
2101 fxEcho(the, " name=\"");
2102 if (theFlag & XS_GETTER_FLAG)
2103 fxEcho(the, "get ");
2104 else if (theFlag & XS_SETTER_FLAG)
2105 fxEcho(the, "set ");
2106 fxEchoPropertyName(the, thePrefix, theIndex, theSuffix, theID);
2107 fxEcho(the, "\"");
2108
2109 if (instanceInspector) {
2110 if (instanceInspector->value.instanceInspector.link) {
2111 txInspectorNameLink* link = theList->first;
2112 fxEcho(the, " value=\"");
2113 while (link) {
2114 fxEchoPropertyName(the, link->prefix, link->index, link->suffix, link->id);
2115 if (link == instanceInspector->value.instanceInspector.link)
2116 break;
2117 fxEcho(the, ".");
2118 link = link->next;
2119 }
2120 fxEcho(the, "\"/>");
2121 }
2122 else {
2123 txInspectorNameLink link;

Callers 3

fxEchoInstanceFunction · 0.85
fxEchoPropertyFunction · 0.85
fxListGlobalFunction · 0.85

Calls 8

fxToInstanceInspectorFunction · 0.85
fxIndexToStringFunction · 0.85
fxIDToStringFunction · 0.85
fxEchoFunction · 0.85
fxEchoFlagsFunction · 0.85
fxEchoPropertyNameFunction · 0.85
fxEchoAddressFunction · 0.85
fxEchoInstanceFunction · 0.85

Tested by

no test coverage detected