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

Function fxBufferFrameName

xs/sources/xsAll.c:94–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void fxBufferFrameName(txMachine* the, txString buffer, txSize size, txSlot* frame, txString suffix)
95{
96 txSlot* function = frame + 2;
97 txSlot* _this = frame + 3;
98 if (function->kind == XS_REFERENCE_KIND) {
99 function = function->value.reference;
100 if (mxIsFunction(function)) {
101 if (!(frame->flag & XS_TARGET_FLAG)) {
102 txSlot* home = mxFunctionInstanceHome(function)->value.home.object;
103 if (home) {
104 if (mxIsFunction(home)) {
105 fxBufferFunctionName(the, buffer, size, home, ".");
106 }
107 else {
108 txSlot* constructor = mxBehaviorGetProperty(the, home, mxID(_constructor), 0, XS_OWN);
109 if (constructor) {
110 if (constructor->kind == XS_REFERENCE_KIND) {
111 constructor = constructor->value.reference;
112 if (mxIsFunction(constructor))
113 fxBufferFunctionName(the, buffer, size, constructor, ".prototype.");
114 }
115 }
116 else if (_this->kind == XS_REFERENCE_KIND) {
117 fxBufferObjectName(the, buffer, size, _this->value.reference, ".");
118 }
119 }
120 }
121 }
122 fxBufferFunctionName(the, buffer, size, function, "");
123 }
124 }
125#if mxHostFunctionPrimitive
126 else if (function->kind == XS_HOST_FUNCTION_KIND) {
127 fxBufferFunctionNameAddress(the, buffer, size, function->value.hostFunction.builder->id, function->value.hostFunction.builder->callback, function->value.hostFunction.profileID);
128 }
129#endif
130 else
131 c_strncat(buffer, "(host)", size - mxStringLength(buffer) - 1);
132 c_strncat(buffer, suffix, size - mxStringLength(buffer) - 1);
133}
134
135void fxBufferFunctionName(txMachine* the, txString buffer, txSize size, txSlot* function, txString suffix)
136{

Callers 2

fxThrowMessageFunction · 0.85
fxEchoFrameNameFunction · 0.85

Calls 2

fxBufferFunctionNameFunction · 0.85
fxBufferObjectNameFunction · 0.85

Tested by

no test coverage detected