diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-04-18 10:18:48 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-05-02 15:46:26 +0000 |
commit | d258c904a6027007d00526ab38b8cc5ba2aed3bf (patch) | |
tree | 5adcfee69c31dc6ab1c8bbe5950415b7d7370e23 /tests/auto/qml/qqmlecmascript/data | |
parent | 02fec0dbd7b9774d17690e378b814ff075ac6299 (diff) |
Throw type errors when attempting to mutate read-only sequence properties
Calling for example Qt.application.arguments.push("...") should throw an
exception.
Task-number: QTBUG-67774
Change-Id: Ifd5cd3357dde510cca77b9b32c9f55f8f72837ff
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/assignSequenceTypes.8.qml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/assignSequenceTypes.8.qml b/tests/auto/qml/qqmlecmascript/data/assignSequenceTypes.8.qml new file mode 100644 index 0000000000..3f838fe8f2 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/assignSequenceTypes.8.qml @@ -0,0 +1,16 @@ +import QtQml 2.0 +QtObject { + function tryWritingReadOnlySequence() { + try { + Qt.application.arguments.push("hello") + } catch (e) { + + try { + Qt.application.arguments.sort() + } catch (e) { + return true + } + } + return false + } +} |