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

Autocompletion for Javascript objects (Object, Array) does not work without "new" keyword

    XMLWordPrintable

Details

    • 38e8c0dfd0fdef1cd069bec0e42ef8c0798bb594

    Description

      In a .js file, declaring a variable the following way offers autocompletion for "board":

      var board = new Array(10);
      

      However, doing the same without the "new" keyword does not work:

      var board = Array(10);
      // no autocompletion
      

      Since the new keyword is not strictly required (stuff works without it), it would be nice to have autocompletion for vars declared also without the new keyword.

      The problem is not just with Array, but also with Object. Additionally, if you declare a variable in JSON, e.g var foo =

      {"bar", "baz"}

      , you get no autocompletion either at the moment.

      Attachments

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

        Activity

          People

            ckamm Christian Kamm
            holmsted Lasse Holmstedt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes