Skip to content

Commit 399fec2

Browse files
markus-waRichard Musiol
authored and
Richard Musiol
committed
syscall/js: document ValueOf() panic
ValueOf() panics if x is not one of the expected types. Change-Id: I1105e46bd09a5ab13c162b77c1c50cc45bce27a2 GitHub-Last-Rev: 34a88ce GitHub-Pull-Request: #28846 Reviewed-on: https://go-review.googlesource.com/c/150138 Reviewed-by: Richard Musiol <[email protected]>
1 parent 55c55dd commit 399fec2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/syscall/js/js.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ func Global() Value {
114114
// | string | string |
115115
// | []interface{} | new array |
116116
// | map[string]interface{} | new object |
117+
//
118+
// Panics if x is not one of the expected types.
117119
func ValueOf(x interface{}) Value {
118120
switch x := x.(type) {
119121
case Value: // should precede Wrapper to avoid a loop

0 commit comments

Comments
 (0)