MCPcopy Create free account
hub / github.com/dop251/goja / exportToArrayOrSlice

Method exportToArrayOrSlice

typedarrays.go:978–984  ·  view source on GitHub ↗
(dst reflect.Value, typ reflect.Type, ctx *objectExportCtx)

Source from the content-addressed store, hash-verified

976}
977
978func (o *dataViewObject) exportToArrayOrSlice(dst reflect.Value, typ reflect.Type, ctx *objectExportCtx) error {
979 if typ == typeBytes {
980 dst.Set(reflect.ValueOf(o.viewedArrayBuf.data[o.byteOffset : o.byteOffset+o.byteLen]))
981 return nil
982 }
983 return o.baseObject.exportToArrayOrSlice(dst, typ, ctx)
984}
985
986func (r *Runtime) _newTypedArrayObject(buf *arrayBufferObject, offset, length, elemSize int, defCtor *Object, arr typedArray, proto *Object) *typedArrayObject {
987 o := &Object{runtime: r}

Callers

nothing calls this directly

Calls 2

SetMethod · 0.65
exportToArrayOrSliceMethod · 0.65

Tested by

no test coverage detected