Commit 57ab1cb2 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS checks: Add tests.

Change-Id: I37852b7b4f1720c276fc3aea3b1892613028ec48
Reviewed-on: http://codereview.qt-project.org/4658

Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 367e27cd
import Qt 4.7
// DEFAULTMSG expression statements should be assignments, calls or delete expressions only
Rectangle {
function foo() {
a // W 9 9
a + b // W 9 13
a()
delete b
a = 12
a += 12
d().foo // W 9 15
}
}
import Qt 4.7
Item {
// DEFAULTMSG 'new' should only be used with functions that start with an uppercase letter
function foo() {
a = new A
a = new A()
a = new a // W 17 17
a = new a() // W 17 17
}
// DEFAULTMSG calls of functions that start with an uppercase letter should use 'new'
function foo() {
a = A() // W 13 13
a = a()
}
}
import Qt 4.7
// DEFAULTMSG blocks do not introduce a new scope, avoid
Rectangle {
function foo() {
{} // W 9 9
if (a) {}
}
onXChanged: {
{} // W 9 9
while (A) {}
}
property int d: {
{} // W 9 9
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment