syscall/js: ValueOf should not panic if the underlying type(kind) is supported #42188
Labels
arch-wasm
WebAssembly issues
FeatureRequest
Issues asking for a new feature that does not need a proposal.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
package main
import "syscall/js"
func main(){
type X string
x := X("hello")
v := js.ValueOf(x)
}
What did you expect to see?
x being converted to a js value.
What did you see instead?
panic: ValueOf: invalid value
I believe this is due the fact that the string value passed on is a typed. Therefore this is a feature/improvement request to make ValueOf accept values whose underlying type matches the accepted types.
The text was updated successfully, but these errors were encountered: