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

Function fxNewProgramInstance

xs/sources/xsType.c:1510–1526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1508}
1509
1510txSlot* fxNewProgramInstance(txMachine* the)
1511{
1512 txSlot* instance;
1513 txSlot* slot;
1514 instance = fxNewSlot(the);
1515 instance->kind = XS_INSTANCE_KIND;
1516 instance->value.instance.garbage = C_NULL;
1517 instance->value.instance.prototype = mxIsReference(the->stack) ? the->stack->value.reference : C_NULL;
1518 the->stack->value.reference = instance;
1519 the->stack->kind = XS_REFERENCE_KIND;
1520 slot = instance->next = fxNewSlot(the);
1521 slot->flag = XS_INTERNAL_FLAG;
1522 slot->kind = XS_PROGRAM_KIND;
1523 slot->value.module.realm = C_NULL;
1524 slot->value.module.id = XS_NO_ID;
1525 return instance;
1526}

Callers 3

fx_CompartmentFunction · 0.85
fxCreateMachineFunction · 0.85
fxCloneMachineFunction · 0.85

Calls 1

fxNewSlotFunction · 0.85

Tested by

no test coverage detected