]> Cypherpunks repositories - gostls13.git/commitdiff
syscall/js: add a note about a bug in TypedArray
authorAgniva De Sarker <agnivade@yahoo.co.in>
Wed, 26 Dec 2018 06:39:49 +0000 (12:09 +0530)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 27 Feb 2019 15:08:01 +0000 (15:08 +0000)
Fixes #29355

Change-Id: I4018d420c8d413b2681744af18ffb65da03ac504
Reviewed-on: https://go-review.googlesource.com/c/155778
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
src/syscall/js/typedarray.go

index aa56cf69f3c5ed60c85e546cafa46b3550c0cfe9..04c00571066405a00ff79f734225437e47235b6e 100644 (file)
@@ -25,6 +25,11 @@ var (
 var _ Wrapper = TypedArray{} // TypedArray must implement Wrapper
 
 // TypedArray represents a JavaScript typed array.
+//
+// BUG(neelance): The typed array currently becomes inaccessible when Go requests more memory
+// from the WebAssembly host. It is recommended to only use the typed array synchronously
+// without keeping a long-lived reference. You can also check if the length property is zero
+// to detect this detached state of the typed array.
 type TypedArray struct {
        Value
 }