aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/compatibilitySemicolon.qml13
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp8
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/compatibilitySemicolon.qml b/tests/auto/qml/qqmlecmascript/data/compatibilitySemicolon.qml
new file mode 100644
index 0000000000..594a1b3605
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/compatibilitySemicolon.qml
@@ -0,0 +1,13 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+
+ // Not correct according to ECMA 5.1, but JSC and V8 accept the following:
+ do {
+ ;
+ } while (false) true
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 0ae06681fd..a99c5fa8be 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -265,6 +265,7 @@ private slots:
void registeredFlagMethod();
void deleteLaterObjectMethodCall();
void automaticSemicolon();
+ void compatibilitySemicolon();
void unaryExpression();
void switchStatement();
void withStatement();
@@ -6600,6 +6601,13 @@ void tst_qqmlecmascript::automaticSemicolon()
QVERIFY(object != 0);
}
+void tst_qqmlecmascript::compatibilitySemicolon()
+{
+ QQmlComponent component(&engine, testFileUrl("compatibilitySemicolon.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
void tst_qqmlecmascript::unaryExpression()
{
QQmlComponent component(&engine, testFileUrl("unaryExpression.qml"));