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

Function fxToSpeciesConstructor

xs/sources/xsType.c:299–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299void fxToSpeciesConstructor(txMachine* the, txSlot* constructor)
300{
301 if (mxIsUndefined(the->stack)) {
302 mxPop();
303 mxPushSlot(constructor);
304 return;
305 }
306 if (!mxIsReference(the->stack)) {
307 mxTypeError("no constructor");
308 }
309 mxGetID(mxID(_Symbol_species));
310 if (mxIsUndefined(the->stack) || mxIsNull(the->stack)) {
311 mxPop();
312 mxPushSlot(constructor);
313 return;
314 }
315 if (!mxIsReference(the->stack) || !mxIsConstructor(the->stack->value.reference))
316 mxTypeError("no constructor");
317}
318
319void fxOrdinaryCall(txMachine* the, txSlot* instance, txSlot* _this, txSlot* arguments)
320{

Calls

no outgoing calls

Tested by

no test coverage detected