Skip to content

Commit de9fdc7

Browse files
ianlancetaylorgopherbot
authored andcommitted
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 <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 17ed215 commit de9fdc7

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/syscall/js/js.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ func ValueOf(x any) Value {
212212

213213
// stringVal copies string x to Javascript and returns a ref.
214214
//
215-
// (noescape): This is safe because no references are maintained to the
216-
// Go string x after the syscall returns.
215+
// Using go:noescape is safe because no references are maintained to the
216+
// Go string x after the syscall returns.
217217
//
218218
//go:wasmimport gojs syscall/js.stringVal
219219
//go:noescape
@@ -302,8 +302,8 @@ func (v Value) Get(p string) Value {
302302

303303
// valueGet returns a ref to JavaScript property p of ref v.
304304
//
305-
// (noescape): This is safe because no references are maintained to the
306-
// Go string p after the syscall returns.
305+
// Using go:noescape is safe because no references are maintained to the
306+
// Go string p after the syscall returns.
307307
//
308308
//go:wasmimport gojs syscall/js.valueGet
309309
//go:noescape
@@ -323,8 +323,8 @@ func (v Value) Set(p string, x any) {
323323

324324
// valueSet sets property p of ref v to ref x.
325325
//
326-
// (noescape): This is safe because no references are maintained to the
327-
// Go string p after the syscall returns.
326+
// Using go:noescape is safe because no references are maintained to the
327+
// Go string p after the syscall returns.
328328
//
329329
//go:wasmimport gojs syscall/js.valueSet
330330
//go:noescape
@@ -342,8 +342,8 @@ func (v Value) Delete(p string) {
342342

343343
// valueDelete deletes the JavaScript property p of ref v.
344344
//
345-
// (noescape): This is safe because no references are maintained to the
346-
// Go string p after the syscall returns.
345+
// Using go:noescape is safe because no references are maintained to the
346+
// Go string p after the syscall returns.
347347
//
348348
//go:wasmimport gojs syscall/js.valueDelete
349349
//go:noescape
@@ -447,10 +447,10 @@ func (v Value) Call(m string, args ...any) Value {
447447

448448
// valueCall does a JavaScript call to the method name m of ref v with the given arguments.
449449
//
450-
// (noescape): This is safe because no references are maintained to the
451-
// Go string m after the syscall returns. Additionally, the args slice
452-
// is only used temporarily to collect the JavaScript objects for
453-
// the JavaScript method invocation.
450+
// Using go:noescape is safe because no references are maintained to the
451+
// Go string m after the syscall returns. Additionally, the args slice
452+
// is only used temporarily to collect the JavaScript objects for
453+
// the JavaScript method invocation.
454454
//
455455
//go:wasmimport gojs syscall/js.valueCall
456456
//go:nosplit
@@ -477,9 +477,9 @@ func (v Value) Invoke(args ...any) Value {
477477

478478
// valueInvoke does a JavaScript call to value v with the given arguments.
479479
//
480-
// (noescape): This is safe because the args slice is only used temporarily
481-
// to collect the JavaScript objects for the JavaScript method
482-
// invocation.
480+
// Using go:noescape is safe because the args slice is only used temporarily
481+
// to collect the JavaScript objects for the JavaScript method
482+
// invocation.
483483
//
484484
//go:wasmimport gojs syscall/js.valueInvoke
485485
//go:noescape
@@ -505,8 +505,8 @@ func (v Value) New(args ...any) Value {
505505

506506
// valueNew uses JavaScript's "new" operator with value v as a constructor and the given arguments.
507507
//
508-
// (noescape): This is safe because the args slice is only used temporarily
509-
// to collect the JavaScript objects for the constructor execution.
508+
// Using go:noescape is safe because the args slice is only used temporarily
509+
// to collect the JavaScript objects for the constructor execution.
510510
//
511511
//go:wasmimport gojs syscall/js.valueNew
512512
//go:noescape
@@ -614,8 +614,8 @@ func valuePrepareString(v ref) (ref, int)
614614

615615
// valueLoadString loads string data located at ref v into byte slice b.
616616
//
617-
// (noescape): This is safe because the byte slice is only used as a destination
618-
// for storing the string data and references to it are not maintained.
617+
// Using go:noescape is safe because the byte slice is only used as a destination
618+
// for storing the string data and references to it are not maintained.
619619
//
620620
//go:wasmimport gojs syscall/js.valueLoadString
621621
//go:noescape
@@ -658,8 +658,8 @@ func CopyBytesToGo(dst []byte, src Value) int {
658658

659659
// copyBytesToGo copies bytes from src to dst.
660660
//
661-
// (noescape): This is safe because the dst byte slice is only used as a dst
662-
// copy buffer and no references to it are maintained.
661+
// Using go:noescape is safe because the dst byte slice is only used as a dst
662+
// copy buffer and no references to it are maintained.
663663
//
664664
//go:wasmimport gojs syscall/js.copyBytesToGo
665665
//go:noescape
@@ -677,10 +677,10 @@ func CopyBytesToJS(dst Value, src []byte) int {
677677
return n
678678
}
679679

680-
// copyBytesToJs copies bytes from src to dst.
680+
// copyBytesToJS copies bytes from src to dst.
681681
//
682-
// (noescape): This is safe because the src byte slice is only used as a src
683-
// copy buffer and no references to it are maintained.
682+
// Using go:noescape is safe because the src byte slice is only used as a src
683+
// copy buffer and no references to it are maintained.
684684
//
685685
//go:wasmimport gojs syscall/js.copyBytesToJS
686686
//go:noescape

0 commit comments

Comments
 (0)