diff options
author | Richard Macklin <richard.github@nrm.com> | 2018-12-01 14:48:24 -0800 |
---|---|---|
committer | Richard Macklin <richard.github@nrm.com> | 2018-12-01 14:49:43 -0800 |
commit | 2bb4fdef5efc70327c018e982ff809a29ac6708b (patch) | |
tree | 51bf25fefd24540a84bb8b27c31e02123e58881c /actioncable/app/assets/javascripts | |
parent | aa1ba9cb244b1e03d36aaa941ae4e91c6713b77e (diff) | |
download | rails-2bb4fdef5efc70327c018e982ff809a29ac6708b.tar.gz rails-2bb4fdef5efc70327c018e982ff809a29ac6708b.tar.bz2 rails-2bb4fdef5efc70327c018e982ff809a29ac6708b.zip |
Replace reference to WebSocket global with ActionCable.adapters.WebSocket
The WebSocket dependency of ActionCable.Connection was made configurable
in 66901c1849efae74c8a58fe0cb36afd487c067cc
However, the reference here in Connection#getState was not updated to
use the configurable property. This change remedies that and adds a test
to verify it. Additionally, it backfills a test to ensure that
Connection#open uses the configurable property.
Diffstat (limited to 'actioncable/app/assets/javascripts')
-rw-r--r-- | actioncable/app/assets/javascripts/action_cable.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actioncable/app/assets/javascripts/action_cable.js b/actioncable/app/assets/javascripts/action_cable.js index 90e8e6b99b..ee11c62eb6 100644 --- a/actioncable/app/assets/javascripts/action_cable.js +++ b/actioncable/app/assets/javascripts/action_cable.js @@ -224,8 +224,8 @@ }; Connection.prototype.getState = function getState() { if (this.webSocket) { - for (var state in WebSocket) { - if (WebSocket[state] === this.webSocket.readyState) { + for (var state in adapters.WebSocket) { + if (adapters.WebSocket[state] === this.webSocket.readyState) { return state.toLowerCase(); } } |