summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-09-25 02:04:17 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-09-25 02:04:17 (GMT)
commita7ee91c6db7dfeb38769c4828f5db926fbd37330 (patch)
tree145dbb5da1a4f76afe9e5ac49fe96481a9c102c1
parentfa369fb1d2d12d1b4791ee197cac3afcd6a4e60b (diff)
downloadQt-a7ee91c6db7dfeb38769c4828f5db926fbd37330.zip
Qt-a7ee91c6db7dfeb38769c4828f5db926fbd37330.tar.gz
Qt-a7ee91c6db7dfeb38769c4828f5db926fbd37330.tar.bz2
Disallow inline var definitions
This was previously just silently ignored.
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 09efc90..c126830 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -769,6 +769,13 @@ bool ProcessAST::visit(AST::UiSourceElement *node)
} else if (AST::VariableStatement *varStmt = AST::cast<AST::VariableStatement *>(node->sourceElement)) {
// ignore variable declarations
line = varStmt->declarationKindToken.startLine;
+
+ QmlError error;
+ error.setDescription(QCoreApplication::translate("QmlParser", "Variable declarations not allow in inline Script blocks"));
+ error.setLine(node->firstSourceLocation().startLine);
+ error.setColumn(node->firstSourceLocation().startColumn);
+ _parser->_errors << error;
+ return false;
}
Value *value = new Value;