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

JS false positive on usage of let

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 15.0.0, Qt Creator 15.0.1
    • Quick / QML Support
    • None
    • Linux/Wayland

    Description

      The following JavaScript in one handler gives false errors on reuse of a variable. Misunderstanding the difference between let and var..

      Component.onCompleted: {
      var list = ['a', 'b']

      for (let i in list)

      { console.log(i) }

      for (let i = 0; i < list.length; i = i + 1) { console.log(i) }

      }

      For full reproducable app, see attached screenshot.

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            tomz Tom Zander
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes