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

Function fxSetHostFunctionProperty

xs/tools/xslSlot.c:1359–1376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1357}
1358
1359void fxSetHostFunctionProperty(txMachine* the, txSlot* property, txCallback call, txInteger length, txID id)
1360{
1361 txLinker* linker = (txLinker*)(the->context);
1362 if (linker->stripFlag) {
1363 property->kind = XS_HOST_FUNCTION_KIND;
1364 property->value.hostFunction.builder = fxNewLinkerBuilder(linker, call, length, id);
1365 property->value.hostFunction.profileID = fxGenerateProfileID(the);
1366 }
1367 else {
1368 txSlot* home = the->stack;
1369 txSlot* function = fxNewHostFunction(the, call, length, id, XS_NO_ID);
1370 txSlot* slot = mxFunctionInstanceHome(function);
1371 slot->value.home.object = home->value.reference;
1372 property->kind = the->stack->kind;
1373 property->value = the->stack->value;
1374 mxPop();
1375 }
1376}

Callers 2

mainFunction · 0.70

Calls 3

fxNewLinkerBuilderFunction · 0.85
fxNewHostFunctionFunction · 0.85
fxGenerateProfileIDFunction · 0.70

Tested by

no test coverage detected