From 99efe4309379482fce5c231885883e359bf85290 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 6 Mar 2014 16:55:09 +0100 Subject: Remove old compiler and VME This removes the bulk of the code. A few smaller cleanups remain, to be done in smaller changes as they move code around. Additionally the "optimize" option of qqmlbundle was removed. It called QQmlScript::Parser::preparseData, which however was not implemented and always returned an empty QByteArray. Therefore "optimize" would not do anything and the class is gone now :) Change-Id: I0c265e756704cb53c5250be1f69e4a3e1b6e64d5 Reviewed-by: Lars Knoll --- tests/auto/qml/qqmllanguage/testtypes.cpp | 68 ------------------------------- 1 file changed, 68 deletions(-) (limited to 'tests/auto/qml/qqmllanguage/testtypes.cpp') diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp index 895d5e75da..08d4d557fd 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.cpp +++ b/tests/auto/qml/qqmllanguage/testtypes.cpp @@ -102,31 +102,6 @@ QVariant myCustomVariantTypeConverter(const QString &data) } -QByteArray CustomBindingParser::compile(const QList &properties) -{ - QByteArray result; - QDataStream ds(&result, QIODevice::WriteOnly); - - ds << properties.count(); - for (int i = 0; i < properties.count(); ++i) { - const QQmlCustomParserProperty &prop = properties.at(i); - ds << prop.name(); - - Q_ASSERT(prop.assignedValues().count() == 1); - QVariant value = prop.assignedValues().first(); - - Q_ASSERT(value.userType() == qMetaTypeId()); - QQmlScript::Variant v = qvariant_cast(value); - Q_ASSERT(v.type() == QQmlScript::Variant::Script); - int bindingId = bindingIdentifier(v, prop.name()); - ds << bindingId; - - ds << prop.location().line; - } - - return result; -} - QByteArray CustomBindingParser::compile(const QV4::CompiledData::QmlUnit *qmlUnit, int objectIndex, const QList &bindings) { Q_UNUSED(objectIndex) @@ -180,49 +155,6 @@ void CustomBinding::componentComplete() } } - -QByteArray EnumSupportingCustomParser::compile(const QList &props) -{ - if (props.count() != 1) { - error(QStringLiteral("Custom parser invoked incorrectly for unit test")); - return QByteArray(); - } - QQmlCustomParserProperty prop = props.first(); - if (prop.name() != QStringLiteral("foo")) { - error(QStringLiteral("Custom parser invoked with the wrong property name")); - return QByteArray(); - } - - if (prop.assignedValues().count() != 1) { - error(QStringLiteral("Custom parser invoked with the wrong property values. Expected only one.")); - return QByteArray(); - } - - QVariant firstValue = prop.assignedValues().first(); - if (firstValue.userType() != qMetaTypeId()) { - error(QStringLiteral("Custom parser invoked with the wrong property value. Expected value instead of object or so")); - return QByteArray(); - } - QQmlScript::Variant value = qvariant_cast(firstValue); - if (!value.isScript()) { - error(QStringLiteral("Custom parser invoked with the wrong property value. Expected script that evaluates to enum")); - return QByteArray(); - } - QByteArray script = value.asScript().toUtf8(); - bool ok; - int v = evaluateEnum(script, &ok); - if (!ok) { - error(QStringLiteral("Custom parser invoked with the wrong property value. Script did not evaluate to enum")); - return QByteArray(); - } - if (v != MyEnum1Class::A_13) { - error(QStringLiteral("Custom parser invoked with the wrong property value. Enum value is not the expected value.")); - return QByteArray(); - } - - return QByteArray(); -} - QByteArray EnumSupportingCustomParser::compile(const QV4::CompiledData::QmlUnit *qmlUnit, int objectIndex, const QList &bindings) { Q_UNUSED(qmlUnit) -- cgit v1.2.3