diff options
Diffstat (limited to 'tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.formatted.qml')
-rw-r--r-- | tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.formatted.qml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.formatted.qml b/tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.formatted.qml new file mode 100644 index 0000000000..edbb12c6e6 --- /dev/null +++ b/tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.formatted.qml @@ -0,0 +1,37 @@ +import QtQuick + +Item { + + function f() { + var count = 0; + class Person { + constructor(name){ + this._name = name; + } + } + class Employee extends Person { + constructor(name, age){ + super(name); + this._name = name; + this._age = age; + ++count; + } + + doWork(){} + + /* do we get the comment? */ get name(){ + return this._name.toUpperCase(); + } + + set name(newName){ + if (newName) { + this._name = newName; + } + } + + static get count(){ + return count; + } + } + } +} |