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

Function fxNewGlobalInstance

xs/sources/xsGlobal.c:172–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172txSlot* fxNewGlobalInstance(txMachine* the)
173{
174 txSlot* instance;
175 txSlot* property;
176 txSize size = fxMultiplyChunkSizes(the, XS_INTRINSICS_COUNT, sizeof(txSlot*));
177 instance = fxNewSlot(the);
178 instance->flag = XS_EXOTIC_FLAG;
179 instance->kind = XS_INSTANCE_KIND;
180 instance->value.instance.garbage = C_NULL;
181 instance->value.instance.prototype = the->stack->value.reference;
182 the->stack->value.reference = instance;
183 the->stack->kind = XS_REFERENCE_KIND;
184 property = instance->next = fxNewSlot(the);
185 property->value.table.address = (txSlot**)fxNewChunk(the, size);
186 c_memset(property->value.table.address, 0, size);
187 property->value.table.length = XS_INTRINSICS_COUNT;
188 property->flag = XS_INTERNAL_FLAG;
189 property->ID = XS_GLOBAL_BEHAVIOR;
190 property->kind = XS_GLOBAL_KIND;
191 return instance;
192}
193
194txBoolean fxGlobalDeleteProperty(txMachine* the, txSlot* instance, txID id, txIndex index)
195{

Callers 2

fx_CompartmentFunction · 0.85
fxCreateMachineFunction · 0.85

Calls 2

fxNewSlotFunction · 0.85
fxNewChunkFunction · 0.85

Tested by

no test coverage detected