Skip to content

Commit

Permalink
ExportTo() now supports exporting of ArrayBuffer and ArrayBuffer-back…
Browse files Browse the repository at this point in the history
…ed values into []byte. Export() of typed arrays returns the typed slice.
  • Loading branch information
dop251 committed May 31, 2023
1 parent b68b745 commit 2352993
Show file tree
Hide file tree
Showing 4 changed files with 481 additions and 87 deletions.
3 changes: 3 additions & 0 deletions runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -2369,6 +2369,9 @@ func (r *Runtime) wrapJSFunc(fn Callable, typ reflect.Type) func(args []reflect.
// If an object has a 'length' property and is not a function it is treated as array-like. The resulting slice
// will contain obj[0], ... obj[length-1].
//
// ArrayBuffer and ArrayBuffer-backed types (i.e. typed arrays and DataView) can be exported into []byte. The result
// is backed by the original data, no copy is performed.
//
// For any other Object an error is returned.
//
// # Array types
Expand Down
Loading

0 comments on commit 2352993

Please sign in to comment.