diff options
author | Bea Lam <bea.lam@nokia.com> | 2011-01-27 05:34:34 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2011-01-27 05:37:10 (GMT) |
commit | 43b8305367156c1ceb09eb4a056bdae3f325b5eb (patch) | |
tree | 8d792838920476495cba22c802939b719619a55d /tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js | |
parent | 357f1163f75e4b23a5b87dd6b3d742d167cd9c10 (diff) | |
download | Qt-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.js | 17 |
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 +} |