paho.mqtt.javascript icon indicating copy to clipboard operation
paho.mqtt.javascript copied to clipboard

Support for the "use strict" directive in JS

Open bitfreak25 opened this issue 9 years ago • 1 comments
trafficstars

As I tried to use the example-code in "mqttws31.js" and use the "use strict" directive (see w3school for definition) I've got an error when debugging in Firefox:

assignment to undeclared variable client

And the Message would not be transmitted. So I think, that the "use strict" directive isn't supported yet. It would be nice to support that in the Future if possible, because it was said that:

  • Strict mode makes it easier to write "secure" JavaScript.
  • Strict mode changes previously accepted "bad syntax" into real errors.

bitfreak25 avatar Jul 26 '16 09:07 bitfreak25

Improving the Javascript library would be very useful, especially making sure that we remove any bad syntax. I'll add this as an enhancement, but not sure about how much work will be needed yet.

jpwsutton avatar Jul 26 '16 09:07 jpwsutton