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

Method exportToArrayOrSlice

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

Source from the content-addressed store, hash-verified

960}
961
962func (a *typedArrayObject) exportToArrayOrSlice(dst reflect.Value, typ reflect.Type, ctx *objectExportCtx) error {
963 if typ == typeBytes {
964 dst.Set(reflect.ValueOf(a.viewedArrayBuf.data[a.offset*a.elemSize : (a.offset+a.length)*a.elemSize]))
965 return nil
966 }
967 return a.baseObject.exportToArrayOrSlice(dst, typ, ctx)
968}
969
970func (a *typedArrayObject) export(_ *objectExportCtx) interface{} {
971 return a.typedArray.export(a.offset, a.length)

Callers

nothing calls this directly

Calls 2

SetMethod · 0.65
exportToArrayOrSliceMethod · 0.65

Tested by

no test coverage detected