react-native/Libraries/WebSocket
Eric Rozell b9be28915c Remove Platform check from WebSocket module
Summary:
WebSocket uses the Platform module to check how many arguments for the `close` method should be used. In react-native-windows, we have the same number of arguments for `close` as Android, so we're prevented from using this module as-is because of the platform check (see https://github.com/Microsoft/react-native-windows/blob/master/Libraries/WebSocket/WebSocket.windows.js#L136).

By switching to an argument count check, this module becomes more useful cross-platform. If you'd like to keep the platform check, I'm also open to inverting the conditional, e.g., `if (Platform.OS !== 'ios')`.

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

I'd like to minimize the amount of code I need to copy over to react-native-windows for platform-specific overrides.

Run jest tests.

N/A

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[GENERAL][MINOR][ENHANCEMENT][Libraries/WebSocket/WebSocket.js] - Better enable cross-platform support of WebSocket.js
Closes https://github.com/facebook/react-native/pull/18056

Differential Revision: D7070380

Pulled By: TheSavior

fbshipit-source-id: 9bfd47654d0bf6f0e07fc799853a206721467525
2018-02-23 11:17:27 -08:00
..
RCTWebSocket.xcodeproj adds --port option to `react-native run-ios` as well as patches port … 2018-01-04 20:11:10 -08:00
__mocks__ Fix WebSocket compatibility with event-target-shim ^1.0.5 2016-04-27 12:26:23 -07:00
__tests__ Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTReconnectingWebSocket.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTReconnectingWebSocket.m Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTSRWebSocket.h Backed out changeset 183744d2415b 2016-03-15 11:49:28 -07:00
RCTSRWebSocket.m Merge RCTPackagerClient into RCTPackagerConnection 2017-05-05 08:49:28 -07:00
RCTWebSocketExecutor.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTWebSocketExecutor.m Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTWebSocketModule.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTWebSocketModule.m Update license headers for MIT license 2018-02-16 18:31:53 -08:00
WebSocket.js Remove Platform check from WebSocket module 2018-02-23 11:17:27 -08:00
WebSocketEvent.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
WebSocketInterceptor.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00