aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/automaticSemicolon.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp9
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/automaticSemicolon.qml b/tests/auto/declarative/qdeclarativeecmascript/data/automaticSemicolon.qml
new file mode 100644
index 0000000000..6db68f2328
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/automaticSemicolon.qml
@@ -0,0 +1,11 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ if (1) {
+ var a;
+ function f1(){}a=1;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index dc3f053e17..36941afc89 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -199,6 +199,8 @@ private slots:
void revisionErrors();
void revision();
+ void automaticSemicolon();
+
private:
QDeclarativeEngine engine;
};
@@ -4199,6 +4201,13 @@ void tst_qdeclarativeecmascript::dynamicString()
QString::fromLatin1("string:Hello World false:0 true:1 uint32:100 int32:-100 double:3.14159 date:2011-02-11 05::30:50!"));
}
+void tst_qdeclarativeecmascript::automaticSemicolon()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("automaticSemicolon.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
QTEST_MAIN(tst_qdeclarativeecmascript)
#include "tst_qdeclarativeecmascript.moc"