diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-03-02 04:48:07 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-03-02 04:49:09 (GMT) |
commit | 861a9f127e04aa135649ed64f268d72da6a35fd9 (patch) | |
tree | c6c2b547a2d7c3dfdd2d2d7508579225817a2585 /tests/auto/declarative/qdeclarativeecmascript/data | |
parent | 3507c6fbbb585ea3b7f6a13b16fa216aea4574ab (diff) | |
download | Qt-861a9f127e04aa135649ed64f268d72da6a35fd9.zip Qt-861a9f127e04aa135649ed64f268d72da6a35fd9.tar.gz Qt-861a9f127e04aa135649ed64f268d72da6a35fd9.tar.bz2 |
Add autotests for script block scoping.
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data')
3 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.1.qml new file mode 100644 index 0000000..9b11fa9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.1.qml @@ -0,0 +1,13 @@ +import Qt.test 1.0 + +MyQmlObject { + property string result + + Script{ + function f() { + result = b + } + + } + onArgumentSignal: f() +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.2.qml new file mode 100644 index 0000000..ec727e2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.2.qml @@ -0,0 +1,11 @@ +import Qt.test 1.0 + +MyQmlObject { + property string result + property string aProp: "hello" + + Script{ + source: "scriptScope.js" + } + onBasicSignal: f() +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.js new file mode 100644 index 0000000..5689930 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.js @@ -0,0 +1,5 @@ +var aProp = "world"; + +function f() { + result = aProp; +} |