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

Function fxTypedArrayGetOwnProperty

xs/sources/xsDataView.c:1302–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1300}
1301
1302txBoolean fxTypedArrayGetOwnProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* slot)
1303{
1304 if ((!id) || fxIsCanonicalIndex(the, id)) {
1305 txSlot* dispatch = instance->next;
1306 txSlot* view = dispatch->next;
1307 txSlot* buffer = view->next;
1308 txU2 shift = dispatch->value.typedArray.dispatch->shift;
1309 txSlot* arrayBuffer = buffer->value.reference->next;
1310 txIndex length = fxGetDataViewSize(the, view, buffer) >> shift;
1311 if ((!id) && (index < length)) {
1312 (*dispatch->value.typedArray.dispatch->getter)(the, buffer->value.reference->next, view->value.dataView.offset + (index << shift), slot, EndianNative);
1313 if (arrayBuffer->flag & XS_DONT_SET_FLAG)
1314 slot->flag |= XS_DONT_DELETE_FLAG | XS_DONT_SET_FLAG;
1315 return 1;
1316 }
1317 slot->kind = XS_UNDEFINED_KIND;
1318 slot->flag = XS_NO_FLAG;
1319 return 0;
1320 }
1321 return fxOrdinaryGetOwnProperty(the, instance, id, index, slot);
1322}
1323
1324txSlot* fxTypedArrayGetProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag)
1325{

Callers

nothing calls this directly

Calls 3

fxIsCanonicalIndexFunction · 0.85
fxGetDataViewSizeFunction · 0.85
fxOrdinaryGetOwnPropertyFunction · 0.85

Tested by

no test coverage detected