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

QtCreator gives warning for Array constructor called as a function

    XMLWordPrintable

Details

    Description

      As per 15.4.1 in ECMA-262 edition 5.1 you can use Array as a function to create and initialize a new Array object. However, Qt Creator has a false negative warning against the usage. In spite of the warning, the Javascript runs correctly. Please refer https://www.ecma-international.org/ecma-262/5.1/#sec-15.4.1

             var indexes =  Array(10,1,3,3);
              console.log(indexes[2])
      

      QtCreator warning: Calls of functions that start with an uppercase letter should use 'new'. (M306)

      Attachments

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

        Activity

          People

            thohartm Thomas Hartmann
            shmittal Shveta Mittal (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes