aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.qml')
-rw-r--r--tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.qml45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.qml b/tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.qml
new file mode 100644
index 0000000000..268859d3cc
--- /dev/null
+++ b/tests/auto/qml/qmlformat/data/ecmaScriptClassInQml.qml
@@ -0,0 +1,45 @@
+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() {
+
+ }
+
+ get /* do we get the comment? */ name() {
+ return this._name.toUpperCase();
+ }
+
+ set name(newName){
+ if(newName){
+ this._name = newName;
+ }
+ }
+
+ static get count() { return count;}
+}
+
+
+}
+
+} \ No newline at end of file