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

readonly property can be written via unqualified access

    XMLWordPrintable

Details

    • e7a2c055b (tqtc/lts-6.2), 53b9c1774 (dev), 557db3f1c (6.6), 0bbf89ac0 (tqtc/lts-6.5)

    Description

      It seems that readonly properties can be written via unqualified access.

      See attached project: it writes 20 to the readonly property and prints 20 when run normally, but prints a TypeError when you run it with QV4_FORCE_INTERPRETER=1.

      While the compiler is happy to modify the readonly with `someNumber = 20`, it does print a TypeError if you do the write with a qualified access `root.someNumber = 20` instead.

       

      Note: the same happens with qmllint too: it is happy with `someNumber = 20`, but complains with the qualified access `root.someNumber = 20` about `Cannot assign to read-only property someNumber [read-only-property]`.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            sami.shalayel Sami Shalayel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes