From: Markus Date: Sat, 17 Nov 2018 19:21:32 +0000 (+0000) Subject: syscall/js: document ValueOf() panic X-Git-Tag: go1.12beta1~304 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=399fec28e22ac01b7a4fe56028c3016a0df6d2e6;p=gostls13.git syscall/js: document ValueOf() panic ValueOf() panics if x is not one of the expected types. Change-Id: I1105e46bd09a5ab13c162b77c1c50cc45bce27a2 GitHub-Last-Rev: 34a88ce8206954d94f0a884ab7f6494116c54a2d GitHub-Pull-Request: golang/go#28846 Reviewed-on: https://go-review.googlesource.com/c/150138 Reviewed-by: Richard Musiol --- diff --git a/src/syscall/js/js.go b/src/syscall/js/js.go index 19cdedc309..885723f87d 100644 --- a/src/syscall/js/js.go +++ b/src/syscall/js/js.go @@ -114,6 +114,8 @@ func Global() Value { // | string | string | // | []interface{} | new array | // | map[string]interface{} | new object | +// +// Panics if x is not one of the expected types. func ValueOf(x interface{}) Value { switch x := x.(type) { case Value: // should precede Wrapper to avoid a loop