Skip to content

Commit 34a88ce

Browse files
authored
syscall/js: Document ValueOf() panic
ValueOf() panics if x is not one of the expected types.
1 parent b65f5c8 commit 34a88ce

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)