Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
Qt Creator 3.4.0
-
None
Description
Typing new Object will result in a static warning from Creator:
Do not use "Object" as a constructor. (M111)
Why? What should I use instead?
If I Google (which I shouldn't have to), I find this page:
http://doc.qt.io/qtcreator/creator-checking-code-syntax.html#checking-javascript-and-qml-syntax
Which says the rules used are the same as JSLint, and links to that:
If I then find the help link:
http://www.jslint.com/help.html
At the end of the page is a section about "Constructors and new":
JSLint does not expect to see new Object. Use Object.create(null) instead.
The user shouldn't have to go through all of this work to find out why what they're doing is wrong.
Attachments
Issue Links
- resulted in
-
QTCREATORBUG-19166 Link to http://linterrors.com/js to better explain QML and JS syntax check warnings
-
- Closed
-