Skip to content

Commit

Permalink
Merge pull request #194 from markevans-sky/no-implicit-global-websocket
Browse files Browse the repository at this point in the history
No implicit global WebSocket
  • Loading branch information
icraggs authored Jun 4, 2019
2 parents 55cf306 + 03c553f commit 026fd95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/paho-mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1057,9 +1057,9 @@ function onMessageArrived(message) {


if (this.connectOptions.mqttVersion < 4) {
this.socket = new WebSocket(wsurl, ["mqttv3.1"]);
this.socket = new global.WebSocket(wsurl, ["mqttv3.1"]);
} else {
this.socket = new WebSocket(wsurl, ["mqtt"]);
this.socket = new global.WebSocket(wsurl, ["mqtt"]);
}
this.socket.binaryType = "arraybuffer";
this.socket.onopen = scope(this._on_socket_open, this);
Expand Down
2 changes: 1 addition & 1 deletion src/test/client-harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ global.Paho = Paho


function ensureValue(prop, value) {
if (prop === '' || prop[0] === '$') {
if (prop === undefined || prop === '' || prop[0] === '$') {
return value
}
return prop
Expand Down

0 comments on commit 026fd95

Please sign in to comment.