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

JS object property name requires quotes in a declaration

    XMLWordPrintable

Details

    • 89cdaa901d227bed35f6c5405ce5d62f352a659c

    Description

      The following example fails, but works if myProp is changed to 'myProp' (with quotes)

      import QtQuick 2.0
      Item {
          property var myObjProp: { myProp: 'true' }
          Component.onCompleted: console.log(myObjProp.myProp)  //prints 'undefined'
      }
      

      The quotes are not required in an imperative code block.

      Attachments

        Issue Links

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

          Activity

            People

              chriadam Christopher Adams (closed Nokia identity) (Inactive)
              brasser Michael Brasser (closed Nokia identity) (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes