aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmltypecompiler.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-19 15:40:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-02 11:46:36 +0100
commit8035d243061abe6b3b37586af688840f529e08a8 (patch)
tree48918e5b7d31b467683b30fe7ffba1cd403f2af2 /src/qml/compiler/qqmltypecompiler.cpp
parentea8fe81141cd19de9eb006153d0939fb4483984e (diff)
[new compiler] Report errors when a property name starts with an upper case letter and lacks a qualification
Change-Id: I66e9669459920cfb3543a3ebcec8501465c2ef85 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler.cpp')
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index fc45d6ce06..f344b3bf27 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -1483,6 +1483,17 @@ bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledD
QString name = stringAt(binding->propertyNameIndex);
+ if (name.constData()->isUpper()) {
+ QQmlType *type = 0;
+ QQmlImportNamespace *typeNamespace = 0;
+ compiler->imports()->resolveType(stringAt(binding->propertyNameIndex), &type, 0, 0, &typeNamespace);
+ if (typeNamespace)
+ recordError(binding->location, tr("Invalid use of namespace"));
+ else
+ recordError(binding->location, tr("Invalid attached object assignment"));
+ return false;
+ }
+
bool bindingToDefaultProperty = false;
bool notInRevision = false;