Details
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
For Gerrit Dashboard: QTBUG-118100 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
512327,3 | QmlCompiler: Prohibit writing to readonly properties | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
512500,2 | Prohibit writing to readonly properties | tqtc/lts-6.2 | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |
512638,2 | QmlCompiler: Prohibit writing to readonly properties | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
512748,2 | QmlCompiler: Prohibit writing to readonly properties | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |