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

fix(WebSocketSubject): Check if WebSocket exists before using it #3694

Merged
merged 1 commit into from
May 21, 2018

Conversation

bbonnet
Copy link
Contributor

@bbonnet bbonnet commented May 14, 2018

Description:
Check to make sure that the WebSocket constructor is in the root before using it. This is currently breaking in Node.

Related issue (if exists):
#3692

@bbonnet bbonnet changed the title fix(WebSocketSubject): Check to see if WebSocket is in root before us… fix(WebSocketSubject): Check if WebSocket is in root before using it May 14, 2018
@coveralls
Copy link

coveralls commented May 14, 2018

Coverage Status

Coverage increased (+0.02%) to 96.648% when pulling 19a8c99 on bbonnet:ws-constructor into 537fe7d on ReactiveX:master.

@@ -7,6 +7,7 @@ import { ReplaySubject } from '../../ReplaySubject';
import { Observer, NextObserver } from '../../types';
import { tryCatch } from '../../util/tryCatch';
import { errorObject } from '../../util/errorObject';
import { root } from '../../util/root';
Copy link
Member

Choose a reason for hiding this comment

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

We want to get away from using root.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@benlesh Updated this to remove root and just see if WebSocket exists in the global scope. Is there a specific reason we're moving away from using root?

Copy link
Member

Choose a reason for hiding this comment

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

It causes weird issues with some bundling setups, and it's just unnecessary code for the most part.

@bbonnet bbonnet changed the title fix(WebSocketSubject): Check if WebSocket is in root before using it fix(WebSocketSubject): Check if WebSocket exists before using it May 15, 2018
@benlesh benlesh merged commit 2db0788 into ReactiveX:master May 21, 2018
@benlesh
Copy link
Member

benlesh commented May 21, 2018

thanks, @bbonnet!

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants