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

Function fxNewHostObject

xs/sources/xsAPI.c:681–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681txSlot* fxNewHostObject(txMachine* the, txDestructor theDestructor)
682{
683 txSlot* anInstance;
684 txSlot* aProperty;
685
686 mxPushUndefined();
687
688 anInstance = fxNewSlot(the);
689 anInstance->kind = XS_INSTANCE_KIND;
690 anInstance->value.instance.garbage = C_NULL;
691 anInstance->value.instance.prototype = mxObjectPrototype.value.reference;
692 the->stack->value.reference = anInstance;
693 the->stack->kind = XS_REFERENCE_KIND;
694
695 aProperty = anInstance->next = fxNewSlot(the);
696 aProperty->flag = XS_INTERNAL_FLAG;
697 aProperty->kind = XS_HOST_KIND;
698 aProperty->value.host.data = C_NULL;
699 aProperty->value.host.variant.destructor = theDestructor;
700
701 return anInstance;
702}
703
704txInteger fxGetHostBufferLength(txMachine* the, txSlot* slot)
705{

Callers 9

_262_agent_start_auxFunction · 0.85
fxLinkerScriptCallbackFunction · 0.85
fxBuildAgentFunction · 0.85
fx_agent_start_auxFunction · 0.85
fx_setTimerFunction · 0.85
fxBuildHostsFunction · 0.85
fxSetArchiveFunction · 0.85
fx_mutabilitiesFunction · 0.85

Calls 1

fxNewSlotFunction · 0.85

Tested by

no test coverage detected