}
reject:
- if (ctx->strictMode)
- ctx->throwTypeError();
+ if (ctx->strictMode) {
+ QString message = QStringLiteral("Cannot assign to read-only property \"");
+ message += name->toQString();
+ message += QLatin1Char('\"');
+ ctx->throwTypeError(message);
+ }
}
void Object::internalPutIndexed(ExecutionContext *ctx, uint index, const Value &value)
QTest::newRow("qobject, writing + readonly constraints")
<< testFileUrl("singletontype/qobjectSingletonTypeWriting.qml")
<< QString()
- << (QStringList() << QString(testFileUrl("singletontype/qobjectSingletonTypeWriting.qml").toString() + QLatin1String(":15: Error: Cannot assign to read-only property \"qobjectTestProperty\"")))
+ << (QStringList() <<
+ QString(testFileUrl("singletontype/qobjectSingletonTypeWriting.qml").toString() + QLatin1String(":15: Error: Cannot assign to read-only property \"qobjectTestProperty\"")))
<< (QStringList() << "readOnlyProperty" << "writableProperty" << "writableFinalProperty")
<< (QVariantList() << 20 << 50 << 10)
<< (QStringList() << "firstProperty" << "secondProperty")
QTest::newRow("script, writing + readonly constraints")
<< testFileUrl("singletontype/scriptSingletonTypeWriting.qml")
<< QString()
- << (QStringList() << QString(testFileUrl("singletontype/scriptSingletonTypeWriting.qml").toString() + QLatin1String(":21: Error: Cannot assign to read-only property \"scriptTestProperty\"")))
+ << (QStringList() <<
+ QString(testFileUrl("singletontype/scriptSingletonTypeWriting.qml").toString() + QLatin1String(":21: TypeError: Cannot assign to read-only property \"scriptTestProperty\"")))
<< (QStringList() << "readBack" << "unchanged")
<< (QVariantList() << 15 << 42)
<< (QStringList() << "firstProperty" << "secondProperty")