Skip to content

Commit

Permalink
Update for go 1.14 Wasm changes
Browse files Browse the repository at this point in the history
  • Loading branch information
M. Hawn committed Oct 15, 2020
1 parent a29417b commit 5a6d40c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2p/transport/websocket/conn_browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,17 @@ func arrayBufferToBytes(buffer js.Value) []byte {

func errorEventToError(val js.Value) error {
var typ string
if gotType := val.Get("type"); gotType != js.Undefined() {
if gotType := val.Get("type"); !gotType.Equal(js.Undefined()) {
typ = gotType.String()
} else {
typ = val.Type().String()
}
var reason string
if gotReason := val.Get("reason"); gotReason != js.Undefined() && gotReason.String() != "" {
if gotReason := val.Get("reason"); !gotReason.Equal(js.Undefined()) && gotReason.String() != "" {
reason = gotReason.String()
} else {
code := val.Get("code")
if code != js.Undefined() {
if !code.Equal(js.Undefined()) {
switch code := code.Int(); code {
case 1006:
reason = "code 1006: connection unexpectedly closed"
Expand Down

0 comments on commit 5a6d40c

Please sign in to comment.