summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-01-27 05:34:34 (GMT)
committerBea Lam <bea.lam@nokia.com>2011-01-27 05:37:10 (GMT)
commit43b8305367156c1ceb09eb4a056bdae3f325b5eb (patch)
tree8d792838920476495cba22c802939b719619a55d /tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js
parent357f1163f75e4b23a5b87dd6b3d742d167cd9c10 (diff)
downloadQt-43b8305367156c1ceb09eb4a056bdae3f325b5eb.zip
Qt-43b8305367156c1ceb09eb4a056bdae3f325b5eb.tar.gz
Qt-43b8305367156c1ceb09eb4a056bdae3f325b5eb.tar.bz2
Allow property bindings to be easily created from JavaScript
Properties can now be assigned a function that returns the binding value. Task-number: QTBUG-14964 Reviewed-by: Aaron Kennedy
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js
new file mode 100644
index 0000000..14daa76
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js
@@ -0,0 +1,17 @@
+function bindProperty()
+{
+ a = (function(){ return aNumber * 10 })
+}
+
+
+function TestObject() { }
+TestObject.prototype.aNumber = 928349
+TestObject.prototype.bindFunction = function() {
+ return this.aNumber * 10 // this should not use the TestObject's aNumber
+}
+var testObj = new TestObject()
+
+function bindPropertyWithThis()
+{
+ a = testObj.bindFunction
+}