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

Function fxConstructTypedArray

xs/sources/xsDataView.c:1464–1481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1462}
1463
1464txSlot* fxConstructTypedArray(txMachine* the)
1465{
1466 txSlot* prototype;
1467 txSlot* dispatch;
1468 txSlot* instance;
1469 if (!mxHasTarget)
1470 mxTypeError("call: TypedArray");
1471 dispatch = mxFunctionInstanceHome(mxFunction->value.reference);
1472 dispatch = dispatch->next;
1473 prototype = mxBehaviorGetProperty(the, mxFunction->value.reference, mxID(_prototype), 0, XS_ANY);
1474 if (!dispatch || (dispatch->kind != XS_TYPED_ARRAY_KIND))
1475 mxTypeError("new: TypedArray");
1476 mxPushSlot(mxTarget);
1477 fxGetPrototypeFromConstructor(the, prototype);
1478 instance = fxNewTypedArrayInstance(the, dispatch->value.typedArray.dispatch, dispatch->value.typedArray.atomics);
1479 mxPullSlot(mxResult);
1480 return instance;
1481}
1482
1483void fxCreateTypedArraySpecies(txMachine* the)
1484{

Callers 1

fx_TypedArrayFunction · 0.85

Calls 2

fxNewTypedArrayInstanceFunction · 0.85

Tested by

no test coverage detected