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

Function fxNewEnvironmentInstance

xs/sources/xsType.c:1156–1175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1154};
1155
1156txSlot* fxNewEnvironmentInstance(txMachine* the, txSlot* environment)
1157{
1158 txSlot* with = the->stack;
1159 txSlot* instance = fxNewSlot(the);
1160 txSlot* slot;
1161 instance->flag = XS_EXOTIC_FLAG;
1162 instance->kind = XS_INSTANCE_KIND;
1163 instance->value.instance.garbage = C_NULL;
1164 instance->value.instance.prototype = (environment && (environment->kind == XS_REFERENCE_KIND)) ? environment->value.reference : C_NULL;
1165 mxPushReference(instance);
1166 slot = instance->next = fxNewSlot(the);
1167 slot->flag = XS_INTERNAL_FLAG;
1168 slot->ID = XS_ENVIRONMENT_BEHAVIOR;
1169 slot->kind = with->kind;
1170 slot->value = with->value;
1171 mxPop();
1172 the->stack->value.reference = instance;
1173 the->stack->kind = XS_REFERENCE_KIND;
1174 return instance;
1175}
1176
1177txBoolean fxEnvironmentDefineOwnProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* slot, txFlag mask)
1178{

Callers 7

fxLinkModulesFunction · 0.85
fx_CompartmentFunction · 0.85
fxRunIDFunction · 0.85
xsRun.cFile · 0.85
fxCreateMachineFunction · 0.85
fxCloneMachineFunction · 0.85
fxDebugEvalExpressionFunction · 0.85

Calls 1

fxNewSlotFunction · 0.85

Tested by

no test coverage detected