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

Function fx_ArrayBuffer_fromBigInt

xs/sources/xsDataView.c:533–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533void fx_ArrayBuffer_fromBigInt(txMachine* the)
534{
535 txU4 minBytes = 0;
536 txBoolean sign = 0;
537 int endian = EndianBig;
538 if (mxArgc < 1)
539 mxTypeError("no argument");
540 if (mxArgc > 1)
541 minBytes = (txU4)fxArgToByteLength(the, 1, 0);
542 if ((mxArgc > 2) && fxToBoolean(the, mxArgv(2)))
543 sign = 1;
544 if ((mxArgc > 3) && fxToBoolean(the, mxArgv(3)))
545 endian = EndianLittle;
546 if (gxTypeBigInt.toArrayBuffer) {
547 gxTypeBigInt.toArrayBuffer(the, mxArgv(0), minBytes, sign, endian);
548 }
549 else {
550 mxUnknownError("not built-in");
551 }
552}
553
554#ifndef mxCESU8
555void fx_ArrayBuffer_fromString(txMachine* the)

Callers

nothing calls this directly

Calls 2

fxArgToByteLengthFunction · 0.85
fxToBooleanFunction · 0.85

Tested by

no test coverage detected