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

Function fxArgToCallback

xs/sources/xsAll.c:66–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66txSlot* fxArgToCallback(txMachine* the, txInteger argi)
67{
68 if (mxArgc > argi) {
69 txSlot* slot = mxArgv(argi);
70 if (slot->kind == XS_REFERENCE_KIND) {
71 txSlot* instance = slot->value.reference;
72again:
73 if (instance) {
74 txSlot* exotic = instance->next;
75 if (exotic && (exotic->flag & XS_INTERNAL_FLAG)) {
76 if (((exotic->kind == XS_CALLBACK_KIND) || (exotic->kind == XS_CALLBACK_X_KIND) || (exotic->kind == XS_CODE_KIND) || (exotic->kind == XS_CODE_X_KIND)))
77 return slot;
78 if (exotic->kind == XS_PROXY_KIND) {
79 instance = exotic->value.proxy.target;
80 goto again;
81 }
82 }
83 }
84 }
85#if mxHostFunctionPrimitive
86 if (slot->kind == XS_HOST_FUNCTION_KIND)
87 return slot;
88#endif
89 }
90 mxTypeError("callback: not a function");
91 return C_NULL;
92}
93
94void fxBufferFrameName(txMachine* the, txString buffer, txSize size, txSlot* frame, txString suffix)
95{

Calls

no outgoing calls

Tested by

no test coverage detected