summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlscriptparser.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-08-24 08:40:40 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-08-24 08:40:40 (GMT)
commite38b15ce001c0bf1cf74c8970cc8a28b6226472b (patch)
tree1500fbbb0373070b08e41119ff11ee13a4214071 /src/declarative/qml/qmlscriptparser.cpp
parentcb81a637c8ef041cff2e96c6065763084776d75a (diff)
downloadQt-e38b15ce001c0bf1cf74c8970cc8a28b6226472b.zip
Qt-e38b15ce001c0bf1cf74c8970cc8a28b6226472b.tar.gz
Qt-e38b15ce001c0bf1cf74c8970cc8a28b6226472b.tar.bz2
Disallow lowercase import qualifier ids
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 418eba7..ca2d295 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -432,8 +432,17 @@ bool ProcessAST::visit(AST::UiImport *node)
AST::SourceLocation startLoc = node->importToken;
AST::SourceLocation endLoc = node->semicolonToken;
- if (node->importId)
+ if (node->importId) {
import.qualifier = node->importId->asString();
+ if (!import.qualifier.at(0).isUpper()) {
+ QmlError error;
+ error.setDescription(QLatin1String("Invalid import qualifier ID"));
+ error.setLine(node->importIdToken.startLine);
+ error.setColumn(node->importIdToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+ }
if (node->versionToken.isValid())
import.version = textAt(node->versionToken);