Use V4 binding for non-final properties where possible
[profile/ivi/qtdeclarative.git] / tests / auto / qml / qqmlecmascript / data / scarceResourceCopyImportFail.var.js
1 .import Qt.test 1.0 as JsQtTest
2
3 // In this case, the "retn" variable will be evaluated during import.
4 // Since the importScarceResource() function depends on this variable,
5 // because we DO NOT call "retn.preserve()", the scarce resource will
6 // be released after the import completes but prior to evaluation of
7 // any binding which calls "importScarceResource()".
8 // Thus, "importScarceResource()" will return a released (invalid)
9 // scarce resource.
10
11 var component = Qt.createComponent("scarceResourceCopy.var.qml");
12 var scarceResourceElement = component.createObject(null);
13 var scarceResourceProvider = scarceResourceElement.a;
14 var retn = scarceResourceProvider.scarceResource;
15
16 function importScarceResource() {
17     return retn; // should return a released (invalid) scarce resource
18 }
19