Prohibit the lexer to synthesize a semicolon token after the
colon-sign of a binding declaration.
The parser internally was rewriting the following bindings
Component.onCompleted:
++foo
as
Component.onCompleted: ;
++foo
Task-number: QTBUG-21310
Change-Id: I0558d17fd81b5abac81fb990502d49767ea40730
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
, _restrictedKeyword(false)
, _terminator(false)
, _followsClosingBrace(false)
- , _delimited(false)
+ , _delimited(true)
, _qmlMode(true)
{
if (engine)
_restrictedKeyword = false;
_terminator = false;
_followsClosingBrace = false;
- _delimited = false;
+ _delimited = true;
}
void Lexer::scanChar()
switch (_tokenKind) {
case T_LBRACE:
case T_SEMICOLON:
+ case T_COLON:
_delimited = true;
break;
--- /dev/null
+import QtQuick 2.0
+
+Item {
+
+ Component.onCompleted:
+++bar
+
+ property int bar: 0
+}
void revision();
void automaticSemicolon();
+ void unaryExpression();
private:
static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
QVERIFY(object != 0);
}
+void tst_qdeclarativeecmascript::unaryExpression()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("unaryExpression.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
// Makes sure that a binding isn't double re-evaluated when it depends on the same variable twice
void tst_qdeclarativeecmascript::doubleEvaluate()
{