-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
v2 does not compile with go1.14 #74
Comments
Thanks for reporting. This is due to |
/cc @neelance @cherrymui FYI, the Go 1.14 change to require use of switch c := o.Get("constructor"); c {
case js.Global().Get("AnimationEvent"):
return &AnimationEvent{ev}
case js.Global().Get("AudioProcessingEvent"):
return &AudioProcessingEvent{ev}
case js.Global().Get("BeforeInputEvent"):
return &BeforeInputEvent{ev}
case js.Global().Get("BeforeUnloadEvent"):
return &BeforeUnloadEvent{ev}
case js.Global().Get("BlobEvent"):
return &BlobEvent{ev}
case js.Global().Get("ClipboardEvent"):
return &ClipboardEvent{ev}
case js.Global().Get("CloseEvent"):
return &CloseEvent{BasicEvent: ev}
case js.Global().Get("CompositionEvent"):
return &CompositionEvent{ev}
case js.Global().Get("CSSFontFaceLoadEvent"):
return &CSSFontFaceLoadEvent{ev}
case js.Global().Get("CustomEvent"):
return &CustomEvent{ev}
... Needs to be rewritten into something like: switch c := o.Get("constructor"); {
case c.Equal(js.Global().Get("AnimationEvent"):
return &AnimationEvent{ev}
case c.Equal(js.Global().Get("AudioProcessingEvent")):
return &AudioProcessingEvent{ev}
case c.Equal(js.Global().Get("BeforeInputEvent")):
return &BeforeInputEvent{ev}
case c.Equal(js.Global().Get("BeforeUnloadEvent")):
return &BeforeUnloadEvent{ev}
case c.Equal(js.Global().Get("BlobEvent")):
return &BlobEvent{ev}
case c.Equal(js.Global().Get("ClipboardEvent")):
return &ClipboardEvent{ev}
case c.Equal(js.Global().Get("CloseEvent")):
return &CloseEvent{BasicEvent: ev}
case c.Equal(js.Global().Get("CompositionEvent")):
return &CompositionEvent{ev}
case c.Equal(js.Global().Get("CSSFontFaceLoadEvent")):
return &CSSFontFaceLoadEvent{ev}
case c.Equal(js.Global().Get("CustomEvent")):
return &CustomEvent{ev}
... Just sharing this observation. |
The syscall/js API has changed in Go 1.14 as described at https://golang.org/doc/go1.14#wasm. Start using it, but keep compatibility for Go 1.13 and older by making copies of .go files and using build constraints. Fixes #74. Co-authored-by: Dmitri Shuralyov <dmitri@shuralyov.com> GitHub-Pull-Request: #75
When building a
v2
-based program with go1.14:The text was updated successfully, but these errors were encountered: