paho.mqtt.javascript
paho.mqtt.javascript copied to clipboard
Support for the "use strict" directive in JS
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.
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.