]> Cypherpunks repositories - gostls13.git/commit
syscall/js: add TypedArrayOf
authorRichard Musiol <mail@richard-musiol.de>
Wed, 27 Jun 2018 15:36:24 +0000 (17:36 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 27 Jun 2018 20:29:21 +0000 (20:29 +0000)
commitbafe466a9537d8ea5ac5767504628803302ebb12
treebeed5451227350c519435fc24053df039711ef8a
parent63a4acba7d19a665f864b929eb8293858d1cee45
syscall/js: add TypedArrayOf

The new function js.TypedArrayOf returns a JavaScript typed array for
a given slice.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays

This change also changes js.ValueOf to not accept a []byte any more.

Fixes #25532.

Change-Id: I8c7bc98ca4e21c3514d19eee7a1f92388d74ab2a
Reviewed-on: https://go-review.googlesource.com/121215
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/crypto/rand/rand_js.go
src/net/http/roundtrip_js.go
src/syscall/fs_js.go
src/syscall/js/js.go
src/syscall/js/js_test.go
src/syscall/js/typedarray.go [new file with mode: 0644]