-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add support for Blob
#2229
Add support for Blob
#2229
Conversation
223c6fc
to
a83321b
Compare
@kettanaito I'm still not very happy with this because, other than compatibility with the WHAWG spec, it is pretty much useless. Anyway, here it is. I also didn't run any benchmarks to see the impact on performance. |
@@ -1030,6 +1031,11 @@ function initAsClient(websocket, address, protocols, options) { | |||
*/ | |||
function emitErrorAndClose(websocket, err) { | |||
websocket._readyState = WebSocket.CLOSING; | |||
// | |||
// The following assignment is practically useless and is done only for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which summarizes the entire change pretty flawlessly. I am still grateful for this consistency! Thank you!
Hi there @lpinca, I can't confirm exactly what's wrong here, but I did a minor version bump and this entirely broke our implementation of |
@titanism are you are setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was just looking at the commit to make sure that upgrading ws
won't break my app. Looks great overall. Just had a small suggestion. :)
websocket._errorEmitted = true; | ||
websocket.emit('error', err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems worthwhile to pull out into a small function:
function emitError(err) {
websocket._errorEmitted = true;
websocket.emit('error', err);
}
Seems like these lines should always be called together. Pulling them out into a function will make it less likely that someone will forget to do so in the future.
Closes #2206