3 import "scarceResourceTest.variant.js" as ScarceResourceProviderJs
5 // In this case, the scarce resource is explicity preserved.
6 // It should not be automatically released after the evaluation
7 // of the binding is complete, but instead will be kept in
8 // memory until the JS garbage collector runs.
11 property MyScarceResourceObject a;
12 a: MyScarceResourceObject { id: scarceResourceProvider }
13 property int scarceResourceTest: ScarceResourceProviderJs.importPreservedScarceResource(scarceResourceProvider),100 // return 100, but the resource should be preserved.