getTypedArrayInfo is a helper function to extract TypedArray information using C API
()
| 842 | |
| 843 | // getTypedArrayInfo is a helper function to extract TypedArray information using C API |
| 844 | func (v *Value) getTypedArrayInfo() (buffer *Value, byteOffset, byteLength, bytesPerElement int) { |
| 845 | var cByteOffset, cByteLength, cBytesPerElement C.size_t |
| 846 | bufferRef := C.JS_GetTypedArrayBuffer(v.ctx.ref, v.ref, &cByteOffset, &cByteLength, &cBytesPerElement) |
| 847 | |
| 848 | return &Value{ctx: v.ctx, ref: bufferRef}, |
| 849 | int(cByteOffset), int(cByteLength), int(cBytesPerElement) |
| 850 | } |
| 851 | |
| 852 | // ToInt8Array converts the value to int8 slice if it's an Int8Array. |
| 853 | func (v *Value) ToInt8Array() ([]int8, error) { |
no outgoing calls
no test coverage detected