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

Function fxEchoProperty

xs/sources/xsDebug.c:1826–1993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1824}
1825
1826void fxEchoProperty(txMachine* the, txSlot* theProperty, txInspectorNameList* theList, txString thePrefix, txIndex theIndex, txString theSuffix)
1827{
1828 txID ID = theProperty->ID;
1829 txFlag flag = theProperty->flag;
1830 txSlot* instance;
1831 if ((theProperty->kind == XS_CLOSURE_KIND) || (theProperty->kind == XS_EXPORT_KIND)) {
1832 theProperty = theProperty->value.closure;
1833 if (!theProperty)
1834 return;
1835#if mxAliasInstance
1836 if (theProperty->ID) {
1837 txSlot* slot = the->aliasArray[theProperty->ID];
1838 if (slot)
1839 theProperty = slot;
1840 }
1841#endif
1842 }
1843 if (theProperty->kind == XS_REFERENCE_KIND) {
1844 instance = fxGetInstance(the, theProperty);
1845 if (instance)
1846 fxEchoPropertyInstance(the, theList, thePrefix, theIndex, theSuffix, ID, flag, instance);
1847 }
1848 else if (theProperty->kind == XS_ACCESSOR_KIND) {
1849 instance = theProperty->value.accessor.getter;
1850 if (instance)
1851 fxEchoPropertyInstance(the, theList, thePrefix, theIndex, theSuffix, ID, flag | XS_GETTER_FLAG, instance);
1852 instance = theProperty->value.accessor.setter;
1853 if (instance)
1854 fxEchoPropertyInstance(the, theList, thePrefix, theIndex, theSuffix, ID, flag | XS_SETTER_FLAG, instance);
1855 }
1856 else {
1857 fxEcho(the, "<property");
1858 fxEchoFlags(the, " ", flag);
1859 fxEcho(the, " name=\"");
1860 fxEchoPropertyName(the, thePrefix, theIndex, theSuffix, ID);
1861 fxEcho(the, "\"");
1862
1863 switch (theProperty->kind) {
1864 case XS_UNDEFINED_KIND:
1865 fxEcho(the, " value=\"undefined\"/>");
1866 break;
1867 case XS_NULL_KIND:
1868 fxEcho(the, " value=\"null\"/>");
1869 break;
1870 case XS_CALLBACK_KIND:
1871 case XS_CALLBACK_X_KIND:
1872 fxEcho(the, " value=\"(C code)\"/>");
1873 break;
1874 case XS_CODE_KIND:
1875 case XS_CODE_X_KIND:
1876 fxEcho(the, " value=\"");
1877 {
1878 txByte* p = theProperty->value.code.address + 2;
1879 if (*p == XS_CODE_FILE) {
1880 txID file;
1881 txS2 line;
1882 p++;
1883 mxDecodeID(p, file);

Callers 6

fxDebugEvalFunction · 0.85
fxEchoInstanceFunction · 0.85
fxEchoPropertyHostFunction · 0.85
fxEchoTypedArrayFunction · 0.85
fxListGlobalFunction · 0.85
fxListLocalFunction · 0.85

Calls 12

fxGetInstanceFunction · 0.85
fxEchoPropertyInstanceFunction · 0.85
fxEchoFunction · 0.85
fxEchoFlagsFunction · 0.85
fxEchoPropertyNameFunction · 0.85
fxEchoStringFunction · 0.85
fxGetKeyNameFunction · 0.85
fxEchoIntegerFunction · 0.85
fxEchoNumberFunction · 0.85
fxEchoBigIntFunction · 0.85
fxGetKeyStringFunction · 0.85
fxGetDataViewSizeFunction · 0.85

Tested by

no test coverage detected