syscall/js: adjust comments to that gofmt does not change them

Change-Id: Ic410375987c0f376d0a975e5a6284de10f08b741
Reviewed-on: https://go-review.googlesource.com/c/go/+/642495
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Ian Lance Taylor 2025-01-13 09:56:13 -08:00 committed by Gopher Robot
parent 17ed215958
commit de9fdc7b71

View file

@ -212,8 +212,8 @@ func ValueOf(x any) Value {
// stringVal copies string x to Javascript and returns a ref.
//
// (noescape): This is safe because no references are maintained to the
// Go string x after the syscall returns.
// Using go:noescape is safe because no references are maintained to the
// Go string x after the syscall returns.
//
//go:wasmimport gojs syscall/js.stringVal
//go:noescape
@ -302,8 +302,8 @@ func (v Value) Get(p string) Value {
// valueGet returns a ref to JavaScript property p of ref v.
//
// (noescape): This is safe because no references are maintained to the
// Go string p after the syscall returns.
// Using go:noescape is safe because no references are maintained to the
// Go string p after the syscall returns.
//
//go:wasmimport gojs syscall/js.valueGet
//go:noescape
@ -323,8 +323,8 @@ func (v Value) Set(p string, x any) {
// valueSet sets property p of ref v to ref x.
//
// (noescape): This is safe because no references are maintained to the
// Go string p after the syscall returns.
// Using go:noescape is safe because no references are maintained to the
// Go string p after the syscall returns.
//
//go:wasmimport gojs syscall/js.valueSet
//go:noescape
@ -342,8 +342,8 @@ func (v Value) Delete(p string) {
// valueDelete deletes the JavaScript property p of ref v.
//
// (noescape): This is safe because no references are maintained to the
// Go string p after the syscall returns.
// Using go:noescape is safe because no references are maintained to the
// Go string p after the syscall returns.
//
//go:wasmimport gojs syscall/js.valueDelete
//go:noescape
@ -447,10 +447,10 @@ func (v Value) Call(m string, args ...any) Value {
// valueCall does a JavaScript call to the method name m of ref v with the given arguments.
//
// (noescape): This is safe because no references are maintained to the
// Go string m after the syscall returns. Additionally, the args slice
// is only used temporarily to collect the JavaScript objects for
// the JavaScript method invocation.
// Using go:noescape is safe because no references are maintained to the
// Go string m after the syscall returns. Additionally, the args slice
// is only used temporarily to collect the JavaScript objects for
// the JavaScript method invocation.
//
//go:wasmimport gojs syscall/js.valueCall
//go:nosplit
@ -477,9 +477,9 @@ func (v Value) Invoke(args ...any) Value {
// valueInvoke does a JavaScript call to value v with the given arguments.
//
// (noescape): This is safe because the args slice is only used temporarily
// to collect the JavaScript objects for the JavaScript method
// invocation.
// Using go:noescape is safe because the args slice is only used temporarily
// to collect the JavaScript objects for the JavaScript method
// invocation.
//
//go:wasmimport gojs syscall/js.valueInvoke
//go:noescape
@ -505,8 +505,8 @@ func (v Value) New(args ...any) Value {
// valueNew uses JavaScript's "new" operator with value v as a constructor and the given arguments.
//
// (noescape): This is safe because the args slice is only used temporarily
// to collect the JavaScript objects for the constructor execution.
// Using go:noescape is safe because the args slice is only used temporarily
// to collect the JavaScript objects for the constructor execution.
//
//go:wasmimport gojs syscall/js.valueNew
//go:noescape
@ -614,8 +614,8 @@ func valuePrepareString(v ref) (ref, int)
// valueLoadString loads string data located at ref v into byte slice b.
//
// (noescape): This is safe because the byte slice is only used as a destination
// for storing the string data and references to it are not maintained.
// Using go:noescape is safe because the byte slice is only used as a destination
// for storing the string data and references to it are not maintained.
//
//go:wasmimport gojs syscall/js.valueLoadString
//go:noescape
@ -658,8 +658,8 @@ func CopyBytesToGo(dst []byte, src Value) int {
// copyBytesToGo copies bytes from src to dst.
//
// (noescape): This is safe because the dst byte slice is only used as a dst
// copy buffer and no references to it are maintained.
// Using go:noescape is safe because the dst byte slice is only used as a dst
// copy buffer and no references to it are maintained.
//
//go:wasmimport gojs syscall/js.copyBytesToGo
//go:noescape
@ -677,10 +677,10 @@ func CopyBytesToJS(dst Value, src []byte) int {
return n
}
// copyBytesToJs copies bytes from src to dst.
// copyBytesToJS copies bytes from src to dst.
//
// (noescape): This is safe because the src byte slice is only used as a src
// copy buffer and no references to it are maintained.
// Using go:noescape is safe because the src byte slice is only used as a src
// copy buffer and no references to it are maintained.
//
//go:wasmimport gojs syscall/js.copyBytesToJS
//go:noescape