From e4b8bafa3be9d5c20b220349d2ffa39a3085b947 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 14 Sep 2011 14:50:24 +0200 Subject: Fix automatic semicolon insertion. The parser should insert a T_SEMICOLON token when it reaches an error state and the lookahead token is following a closing brace. Change-Id: Ib849e7fbfe50c2a3e679ae0794f5780cc0b94de5 Reviewed-on: http://codereview.qt-project.org/4896 Reviewed-by: Qt Sanity Bot Reviewed-by: Kent Hansen --- .../qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp') 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" -- cgit v1.2.3