Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syscall/js: Common DOM event handler pattern panics during handleEvent() #42523

Closed
smoyer64 opened this issue Nov 11, 2020 · 1 comment
Closed

Comments

@smoyer64
Copy link

What version of Go are you using (go version)?

1.15.4

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

This is for a WASM target.

What did you do?

It's common for even handler in Javascript to not return a value at all. This is most analog to 'js.Undefined()' in js.go. Handle event tries to set result which subsequently fails because it calls ValueOf which doesn't support the undefined type. (

func ValueOf(x interface{}) Value {

What did you expect to see?

I expected the click handler to return after changing attributes of the element

What did you see instead?

The program panicked and the WASM code stopped executing in the browser.

@smoyer64 smoyer64 changed the title syscall/js: syscall/js: Common DOM event handler pattern fails during handleEvent() Nov 11, 2020
@smoyer64 smoyer64 changed the title syscall/js: Common DOM event handler pattern fails during handleEvent() syscall/js: Common DOM event handler pattern panics during handleEvent() Nov 12, 2020
@smoyer64
Copy link
Author

js.Undefined() is in fact handled properly after a call or two of recursion.

@golang golang locked and limited conversation to collaborators Nov 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants