Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-16771

Don't tell the user not to do something in JavaScript without giving them any further information

    XMLWordPrintable

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:

      http://www.jslint.com/

      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mabenell Marco Benelli
              mitch_curtis Mitch Curtis
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes