From 43732816be576bfa3b57e58941d7a46b46090dc3 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 26 Dec 2018 12:09:49 +0530 Subject: [PATCH] syscall/js: add a note about a bug in TypedArray MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes #29355 Change-Id: I4018d420c8d413b2681744af18ffb65da03ac504 Reviewed-on: https://go-review.googlesource.com/c/155778 Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot Reviewed-by: Richard Musiol --- src/syscall/js/typedarray.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/syscall/js/typedarray.go b/src/syscall/js/typedarray.go index aa56cf69f3..04c0057106 100644 --- a/src/syscall/js/typedarray.go +++ b/src/syscall/js/typedarray.go @@ -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 } -- 2.50.0