Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-110305

Incomplete support for ES6 destructuring

    XMLWordPrintable

Details

    Description

      Code

      import QtQuick 2.15
      import QtQuick.Window 2.15
      
      Window {
          width: 640
          height: 480
          visible: true
      
          Component.onCompleted: {
              console.log("Assigning constants...")
              let [a, b] = [1, 2]
              console.log(a, b)
      
              console.log("Swapping variables...")
              [a, b] = [b, a]
              console.log(a, b)
          }
      }
      

       

      Output

      qml: Assigning constants...
      qml: 1 2
      qml: Swapping variables...
      qrc:/main.qml:14: TypeError: Value is undefined and could not be converted to an object
      

      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
            jksh Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes