Skip to content

Fix WebSocket#onerror #773

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

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26693,7 +26693,7 @@ WebSocket[JC] def close(code: Int?, reason: String?): Unit
WebSocket[JC] def dispatchEvent(evt: Event): Boolean
WebSocket[JC] def extensions: String
WebSocket[JC] var onclose: js.Function1[CloseEvent, _]
WebSocket[JC] var onerror: js.Function1[ErrorEvent, _]
WebSocket[JC] var onerror: js.Function1[Error, _]
WebSocket[JC] var onmessage: js.Function1[MessageEvent, _]
WebSocket[JC] var onopen: js.Function1[Event, _]
WebSocket[JC] def readyState: Int
Expand Down
2 changes: 1 addition & 1 deletion api-reports/2_13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26693,7 +26693,7 @@ WebSocket[JC] def close(code: Int?, reason: String?): Unit
WebSocket[JC] def dispatchEvent(evt: Event): Boolean
WebSocket[JC] def extensions: String
WebSocket[JC] var onclose: js.Function1[CloseEvent, _]
WebSocket[JC] var onerror: js.Function1[ErrorEvent, _]
WebSocket[JC] var onerror: js.Function1[Error, _]
WebSocket[JC] var onmessage: js.Function1[MessageEvent, _]
WebSocket[JC] var onopen: js.Function1[Event, _]
WebSocket[JC] def readyState: Int
Expand Down
2 changes: 1 addition & 1 deletion dom/src/main/scala/org/scalajs/dom/WebSocket.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class WebSocket(var url: String = js.native, var protocol: String = js.native) e
var onclose: js.Function1[CloseEvent, _] = js.native

/** An event listener to be called when an error occurs. This is a simple event named "error". */
var onerror: js.Function1[ErrorEvent, _] = js.native
var onerror: js.Function1[Error, _] = js.native
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gah, this PR was an utter fail 🤦 it's an ordinary Event, not an ordinary Error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh snap, I totally whooshed as well


/** A string indicating the type of binary data being transmitted by the connection. This should be either "blob" if
* DOM Blob objects are being used or "arraybuffer" if ArrayBuffer objects are being used.
Expand Down