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

Function fxCheckProxyFunction

xs/sources/xsProxy.c:161–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159 mxPop()
160
161txSlot* fxCheckProxyFunction(txMachine* the, txSlot* proxy, txID index)
162{
163 txSlot* function;
164 mxCheckCStack();
165 if (!proxy->value.proxy.handler)
166 mxTypeError("(proxy).%s: no handler", fxName(the, mxID(index)));
167 if (!proxy->value.proxy.target)
168 mxTypeError("(proxy).%s: no target", fxName(the, mxID(index)));
169 mxPushReference(proxy->value.proxy.target);
170 mxPushReference(proxy->value.proxy.handler);
171 mxDub();
172 mxGetID(mxID(index));
173 function = the->stack;
174 if (mxIsUndefined(function) || (mxIsNull(function)))
175 function = C_NULL;
176 else if (!fxIsCallable(the, function))
177 mxTypeError("(proxy).%s: not a function", fxName(the, mxID(index)));
178 return function;
179}
180
181void fxProxyGetter(txMachine* the)
182{

Callers

nothing calls this directly

Calls 2

fxNameFunction · 0.85
fxIsCallableFunction · 0.85

Tested by

no test coverage detected