@qooxdoo/framework 7.9.2 → 8.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (593) hide show
  1. package/CHANGELOG.md +191 -33
  2. package/Manifest.json +3 -3
  3. package/bin/tools/utils.js +50 -13
  4. package/lib/compiler/compile-info.json +300 -230
  5. package/lib/compiler/index.js +56748 -44036
  6. package/lib/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-node.tmpl.js +1 -0
  7. package/lib/resource/qx/tool/compiler/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +1 -0
  8. package/{source/resource/qx/tool → lib/resource/qx/tool/compiler}/cli/templates/template_vars.js +12 -9
  9. package/{source/resource/qx/tool → lib/resource/qx/tool/compiler}/schema/Manifest-1-0-0.json +2 -2
  10. package/lib/resource/qx/tool/{schema → compiler/schema}/Manifest-2-0-0.json +2 -2
  11. package/lib/resource/qx/tool/{schema → compiler/schema}/compile-1-0-0.json +15 -3
  12. package/{source/resource/qx/tool → lib/resource/qx/tool/compiler}/schema/qooxdoo-1-0-0.json +1 -1
  13. package/lib/resource/qx/tool/website/build/404.html +22 -22
  14. package/lib/resource/qx/tool/website/build/about.html +23 -23
  15. package/lib/resource/qx/tool/website/build/assets/common.js +30 -18
  16. package/lib/resource/qx/tool/website/build/assets/custom.css +290 -0
  17. package/lib/resource/qx/tool/website/build/assets/qxWeb.js +28 -0
  18. package/lib/resource/qx/tool/website/build/diagnostics/dependson.html +30 -30
  19. package/lib/resource/qx/tool/website/build/diagnostics/dependson.js +49 -40
  20. package/lib/resource/qx/tool/website/build/diagnostics/requiredby.html +20 -23
  21. package/lib/resource/qx/tool/website/build/diagnostics/requiredby.js +38 -31
  22. package/lib/resource/qx/tool/website/build/index.html +24 -24
  23. package/lib/resource/qx/tool/website/build/scripts/serve.js +63 -65
  24. package/lib/resource/qx/tool/website/partials/footer.html +8 -13
  25. package/lib/resource/qx/tool/website/partials/head.html +9 -7
  26. package/lib/resource/qx/tool/website/partials/header.html +3 -3
  27. package/lib/resource/qx/tool/website/src/assets/common.js +32 -0
  28. package/lib/resource/qx/tool/website/src/assets/custom.css +290 -0
  29. package/lib/resource/qx/tool/website/src/assets/qxWeb.js +28 -0
  30. package/lib/resource/qx/tool/website/src/diagnostics/dependson.js +49 -40
  31. package/lib/resource/qx/tool/website/src/diagnostics/requiredby.js +38 -31
  32. package/lib/resource/qx/tool/website/src/index.html +2 -2
  33. package/lib/resource/qx/tool/website/src/scripts/serve.js +63 -65
  34. package/package.json +20 -19
  35. package/source/boot/index.html +2 -2
  36. package/source/class/qx/Bootstrap.js +931 -705
  37. package/source/class/qx/Class.js +1476 -1451
  38. package/source/class/qx/Interface.js +40 -107
  39. package/source/class/qx/Mixin.js +58 -116
  40. package/source/class/qx/Promise.js +1 -0
  41. package/source/class/qx/Theme.js +1 -1
  42. package/source/class/qx/application/Routing.js +2 -0
  43. package/source/class/qx/bom/Font.js +3 -0
  44. package/source/class/qx/bom/client/Locale.js +5 -0
  45. package/source/class/qx/bom/request/Jsonp.js +5 -13
  46. package/source/class/qx/bom/request/Script.js +11 -35
  47. package/source/class/qx/bom/request/SimpleXhr.js +13 -41
  48. package/source/class/qx/bom/request/Xhr.js +19 -80
  49. package/source/class/qx/bom/storage/Memory.js +2 -0
  50. package/source/class/qx/bom/storage/UserData.js +2 -0
  51. package/source/class/qx/bom/storage/Web.js +2 -0
  52. package/source/class/qx/bom/webfonts/Validator.js +13 -5
  53. package/source/class/qx/core/Assert.js +14 -0
  54. package/source/class/qx/core/BaseInit.js +19 -20
  55. package/source/class/qx/core/Environment.js +23 -20
  56. package/source/class/qx/core/MEvent.js +1 -1
  57. package/source/class/qx/core/MObjectId.js +8 -6
  58. package/source/class/qx/core/MProperty.js +172 -136
  59. package/source/class/qx/core/Object.js +88 -102
  60. package/source/class/qx/core/check/AbstractCheck.js +111 -0
  61. package/source/class/qx/core/check/Any.js +63 -0
  62. package/source/class/qx/core/check/CheckFactory.js +151 -0
  63. package/source/class/qx/core/check/DynamicTypeCheck.js +90 -0
  64. package/source/class/qx/core/check/ICheck.js +75 -0
  65. package/source/class/qx/core/check/IsOneOfCheck.js +63 -0
  66. package/source/class/qx/core/check/JsDocCheck.js +71 -0
  67. package/source/class/qx/core/check/SimpleCheck.js +42 -0
  68. package/source/class/qx/core/check/standard/ArrayCheck.js +49 -0
  69. package/source/class/qx/core/check/standard/BooleanCheck.js +47 -0
  70. package/source/class/qx/core/check/standard/ClassCheck.js +33 -0
  71. package/source/class/qx/core/check/standard/ColorCheck.js +33 -0
  72. package/source/class/qx/core/check/standard/DateCheck.js +49 -0
  73. package/source/class/qx/core/check/standard/DecoratorCheck.js +33 -0
  74. package/source/class/qx/core/check/standard/DocumentCheck.js +40 -0
  75. package/source/class/qx/core/check/standard/ElementCheck.js +40 -0
  76. package/source/class/qx/core/check/standard/ErrorCheck.js +46 -0
  77. package/source/class/qx/core/check/standard/EventCheck.js +40 -0
  78. package/source/class/qx/core/check/standard/FontCheck.js +33 -0
  79. package/source/class/qx/core/check/standard/FunctionCheck.js +49 -0
  80. package/source/class/qx/core/check/standard/IntegerCheck.js +54 -0
  81. package/source/class/qx/core/check/standard/InterfaceCheck.js +33 -0
  82. package/source/class/qx/core/check/standard/MapCheck.js +33 -0
  83. package/source/class/qx/core/check/standard/MixinCheck.js +33 -0
  84. package/source/class/qx/core/check/standard/NodeCheck.js +40 -0
  85. package/source/class/qx/core/check/standard/NumberCheck.js +48 -0
  86. package/source/class/qx/core/check/standard/ObjectCheck.js +33 -0
  87. package/source/class/qx/core/check/standard/PositiveIntegerCheck.js +45 -0
  88. package/source/class/qx/core/check/standard/PositiveNumberCheck.js +45 -0
  89. package/source/class/qx/core/check/standard/PromiseCheck.js +33 -0
  90. package/source/class/qx/core/check/standard/RegExpCheck.js +46 -0
  91. package/source/class/qx/core/check/standard/StringCheck.js +43 -0
  92. package/source/class/qx/core/check/standard/ThemeCheck.js +33 -0
  93. package/source/class/qx/core/check/standard/WindowCheck.js +40 -0
  94. package/source/class/qx/core/property/ExplicitPropertyStorage.js +87 -0
  95. package/source/class/qx/core/property/GroupProperty.js +262 -0
  96. package/source/class/qx/core/property/IProperty.js +46 -0
  97. package/source/class/qx/core/property/IPropertyStorage.js +83 -0
  98. package/source/class/qx/core/property/ImmutableArrayStorage.js +38 -0
  99. package/source/class/qx/core/property/ImmutableDataArrayStorage.js +38 -0
  100. package/source/class/qx/core/property/ImmutableObjectStorage.js +39 -0
  101. package/source/class/qx/core/property/Property.js +1481 -0
  102. package/source/class/qx/core/property/PropertyStorageFactory.js +22 -0
  103. package/source/class/qx/core/property/SimplePropertyStorage.js +105 -0
  104. package/source/class/qx/data/Array.js +102 -57
  105. package/source/class/qx/data/MBinding.js +4 -29
  106. package/source/class/qx/data/SingleValueBinding.js +596 -1495
  107. package/source/class/qx/data/binding/AbstractSegment.js +197 -0
  108. package/source/class/qx/data/binding/ArrayIndexSegment.js +148 -0
  109. package/source/class/qx/data/binding/IInputReceiver.js +14 -0
  110. package/source/class/qx/data/binding/PropNameSegment.js +150 -0
  111. package/source/class/qx/data/controller/CheckedList.js +1 -1
  112. package/source/class/qx/data/controller/Form.js +78 -8
  113. package/source/class/qx/data/controller/Tree.js +27 -117
  114. package/source/class/qx/data/marshal/Json.js +46 -149
  115. package/source/class/qx/data/store/Json.js +0 -2
  116. package/source/class/qx/dev/Debug.js +1 -1
  117. package/source/class/qx/dev/LeakDetector.js +144 -0
  118. package/source/class/qx/dev/unit/AsyncWrapper.js +1 -0
  119. package/source/class/qx/dev/unit/MMock.js +7 -2
  120. package/source/class/qx/dev/unit/Sinon.js +0 -4
  121. package/source/class/qx/dev/unit/TestClass.js +2 -2
  122. package/source/class/qx/dev/unit/TestFunction.js +1 -0
  123. package/source/class/qx/dev/unit/TestLoaderBasic.js +1 -0
  124. package/source/class/qx/dev/unit/TestRunner.js +106 -0
  125. package/source/class/qx/event/IEventDispatcher.js +8 -4
  126. package/source/class/qx/event/Manager.js +4 -0
  127. package/source/class/qx/event/Messaging.js +2 -0
  128. package/source/class/qx/event/Pool.js +7 -0
  129. package/source/class/qx/event/Registration.js +33 -55
  130. package/source/class/qx/event/Timer.js +2 -0
  131. package/source/class/qx/event/Utils.js +25 -8
  132. package/source/class/qx/event/dispatch/AbstractBubbling.js +98 -194
  133. package/source/class/qx/event/dispatch/Direct.js +18 -13
  134. package/source/class/qx/event/handler/Appear.js +20 -24
  135. package/source/class/qx/event/handler/Application.js +4 -0
  136. package/source/class/qx/event/handler/DragDrop.js +182 -385
  137. package/source/class/qx/event/handler/Element.js +3 -0
  138. package/source/class/qx/event/handler/Focus.js +36 -30
  139. package/source/class/qx/event/handler/Input.js +5 -0
  140. package/source/class/qx/event/handler/Keyboard.js +107 -165
  141. package/source/class/qx/event/handler/Pointer.js +39 -68
  142. package/source/class/qx/event/handler/PointerCore.js +7 -25
  143. package/source/class/qx/event/handler/Window.js +5 -0
  144. package/source/class/qx/event/type/Event.js +12 -0
  145. package/source/class/qx/event/type/KeySequence.js +3 -0
  146. package/source/class/qx/event/type/Native.js +3 -0
  147. package/source/class/qx/html/Element.js +26 -91
  148. package/source/class/qx/io/jsonrpc/Client.js +1 -1
  149. package/source/class/qx/io/jsonrpc/protocol/Error.js +2 -2
  150. package/source/class/qx/io/jsonrpc/protocol/Parser.js +1 -0
  151. package/source/class/qx/io/jsonrpc/protocol/Result.js +2 -2
  152. package/source/class/qx/io/request/Xhr.js +3 -8
  153. package/source/class/qx/lang/normalize/Array.js +23 -1
  154. package/source/class/qx/locale/Date.js +520 -113
  155. package/source/class/qx/locale/LocalizedString.js +3 -0
  156. package/source/class/qx/locale/Manager.js +14 -3
  157. package/source/class/qx/locale/Number.js +60 -7
  158. package/source/class/qx/log/Logger.js +1 -1
  159. package/source/class/qx/module/Animation.js +2 -0
  160. package/source/class/qx/module/Attribute.js +2 -0
  161. package/source/class/qx/module/Css.js +7 -24
  162. package/source/class/qx/module/Event.js +2 -0
  163. package/source/class/qx/module/Manipulating.js +2 -0
  164. package/source/class/qx/module/Traversing.js +2 -0
  165. package/source/class/qx/test/Bootstrap.js +68 -53
  166. package/source/class/qx/test/Class.js +310 -2
  167. package/source/class/qx/test/Mixin.js +192 -42
  168. package/source/class/qx/test/Promise.js +129 -331
  169. package/source/class/qx/test/Theme.js +11 -0
  170. package/source/class/qx/test/bom/Font.js +2 -5
  171. package/source/class/qx/test/bom/Template.js +1 -1
  172. package/source/class/qx/test/compiler/ClassFile.js +14 -0
  173. package/source/class/qx/test/core/Assert.js +12 -0
  174. package/source/class/qx/test/core/Environment.js +17 -3
  175. package/source/class/qx/test/core/InheritanceDummy.js +10 -1
  176. package/source/class/qx/test/core/Object.js +51 -24
  177. package/source/class/qx/test/core/ObjectId.js +10 -1
  178. package/source/class/qx/test/core/Property.js +1338 -121
  179. package/source/class/qx/test/core/PropertyHelper.js +12 -0
  180. package/source/class/qx/test/core/Target.js +1 -0
  181. package/source/class/qx/test/core/Validation.js +2 -0
  182. package/source/class/qx/test/data/DataArray.js +218 -639
  183. package/source/class/qx/test/data/DataArrayWithChangeBubble.js +45 -215
  184. package/source/class/qx/test/data/MultiBinding.js +42 -0
  185. package/source/class/qx/test/data/async/__init__.js +4 -0
  186. package/source/class/qx/test/data/controller/Form.js +523 -14
  187. package/source/class/qx/test/data/controller/List.js +94 -426
  188. package/source/class/qx/test/data/controller/ListReverse.js +5 -20
  189. package/source/class/qx/test/data/controller/ListWithObjects.js +49 -225
  190. package/source/class/qx/test/data/controller/Object.js +54 -222
  191. package/source/class/qx/test/data/controller/Tree.js +195 -934
  192. package/source/class/qx/test/data/marshal/Json.js +74 -312
  193. package/source/class/qx/test/data/singlevalue/Array.js +55 -279
  194. package/source/class/qx/test/data/singlevalue/Async.js +173 -0
  195. package/source/class/qx/test/data/singlevalue/Deep.js +148 -327
  196. package/source/class/qx/test/data/singlevalue/Resolve.js +8 -28
  197. package/source/class/qx/test/data/singlevalue/Simple.js +124 -359
  198. package/source/class/qx/test/data/store/Json.js +86 -254
  199. package/source/class/qx/test/data/store/Jsonp.js +9 -29
  200. package/source/class/qx/test/data/store/Offline.js +2 -8
  201. package/source/class/qx/test/data/store/Rest.js +3 -3
  202. package/source/class/qx/test/dev/unit/Requirements.js +26 -10
  203. package/source/class/qx/test/event/GlobalError.js +2 -2
  204. package/source/class/qx/test/html/Iframe.js +1 -1
  205. package/source/class/qx/test/io/graphql/Client.js +2 -0
  206. package/source/class/qx/test/io/jsonrpc/Protocol.js +4 -2
  207. package/source/class/qx/test/io/request/MRequest.js +2 -8
  208. package/source/class/qx/test/io/request/Xhr.js +27 -117
  209. package/source/class/qx/test/lang/Function.js +6 -25
  210. package/source/class/qx/test/lang/Type.js +31 -13
  211. package/source/class/qx/test/locale/Date.js +173 -2
  212. package/source/class/qx/test/locale/Locale.js +23 -28
  213. package/source/class/qx/test/locale/Number.js +71 -0
  214. package/source/class/qx/test/log/Logger.js +7 -1
  215. package/source/class/qx/test/log/fixture/ClassA.js +2 -5
  216. package/source/class/qx/test/mobile/basic/Atom.js +3 -3
  217. package/source/class/qx/test/mobile/container/Scroll.js +4 -4
  218. package/source/class/qx/test/mobile/form/CheckBox.js +6 -12
  219. package/source/class/qx/test/performance/Property.js +5 -4
  220. package/source/class/qx/test/performance/widget/WidgetWithDecorator.js +2 -0
  221. package/source/class/qx/test/theme/Simple.js +34 -0
  222. package/source/class/qx/test/{MAppearance.js → theme/SimpleAppearance.js} +5 -4
  223. package/source/class/qx/test/{MDecoration.js → theme/SimpleDecoration.js} +6 -4
  224. package/source/class/qx/test/theme/manager/Meta.js +7 -5
  225. package/source/class/qx/test/tool/__init__.js +3 -0
  226. package/source/class/qx/test/tool/cli/AbstractValue.js +274 -0
  227. package/source/class/qx/test/tool/cli/Argument.js +384 -0
  228. package/source/class/qx/test/tool/cli/Command.js +387 -0
  229. package/source/class/qx/test/tool/cli/Flag.js +413 -0
  230. package/source/class/qx/test/tool/cli/__init__.js +3 -0
  231. package/source/class/qx/test/ui/LayoutTestCase.js +1 -14
  232. package/source/class/qx/test/ui/basic/Label.js +106 -0
  233. package/source/class/qx/test/ui/core/Blocker.js +125 -3
  234. package/source/class/qx/test/ui/form/Form.js +106 -0
  235. package/source/class/qx/test/ui/form/FormManager.js +6 -5
  236. package/source/class/qx/test/ui/form/SplitButton.js +1 -1
  237. package/source/class/qx/test/ui/toolbar/OverflowHandling.js +13 -14
  238. package/source/class/qx/test/ui/toolbar/ToolBar.js +16 -16
  239. package/source/class/qx/test/ui/tree/TreeFolder.js +5 -7
  240. package/source/class/qx/test/ui/tree/virtual/AbstractTreeTest.js +2 -0
  241. package/source/class/qx/test/ui/tree/virtual/Tree.js +36 -0
  242. package/source/class/qx/test/util/DateFormat.js +1 -1
  243. package/source/class/qx/test/util/PropertyUtil.js +0 -36
  244. package/source/class/qx/theme/classic/Appearance.js +1 -1
  245. package/source/class/qx/theme/indigo/ColorDark.js +2 -0
  246. package/source/class/qx/theme/manager/Font.js +6 -1
  247. package/source/class/qx/theme/manager/Meta.js +2 -1
  248. package/source/class/qx/theme/simple/Appearance.js +31 -95
  249. package/source/class/qx/theme/simple/Decoration.js +0 -1
  250. package/source/class/qx/theme/tangible/Appearance.js +1 -1
  251. package/source/class/qx/tool/cli/AbstractCliApp.js +72 -0
  252. package/source/class/qx/tool/cli/AbstractValue.js +186 -0
  253. package/source/class/qx/tool/cli/Argument.js +155 -0
  254. package/source/class/qx/tool/cli/Command.js +518 -0
  255. package/source/class/qx/tool/cli/Flag.js +202 -0
  256. package/source/class/qx/tool/cli/Parser.js +39 -0
  257. package/source/class/qx/tool/cli/__init__.js +26 -1
  258. package/source/class/qx/tool/compiler/Analyser.js +41 -13
  259. package/source/class/qx/tool/compiler/ClassFile.js +37 -9
  260. package/source/class/qx/tool/compiler/Console.js +2 -0
  261. package/source/class/qx/tool/compiler/MetaExtraction.js +53 -33
  262. package/source/class/qx/tool/compiler/app/Library.js +1 -1
  263. package/source/class/qx/tool/compiler/app/WebFont.js +2 -0
  264. package/source/class/qx/tool/compiler/cli/Application.js +58 -0
  265. package/source/class/qx/tool/{cli/commands → compiler/cli}/Command.js +99 -45
  266. package/source/class/qx/tool/{cli → compiler/cli}/ConfigDb.js +7 -7
  267. package/source/class/qx/tool/compiler/cli/ConfigLoader.js +272 -0
  268. package/source/class/qx/tool/{cli → compiler/cli}/LibraryApplication.js +3 -3
  269. package/source/class/qx/tool/compiler/cli/RootCommand.js +63 -0
  270. package/source/class/qx/tool/{cli → compiler/cli}/Watch.js +49 -24
  271. package/source/class/qx/tool/compiler/cli/__init__.js +3 -0
  272. package/source/class/qx/tool/{cli → compiler/cli}/api/AbstractApi.js +2 -11
  273. package/source/class/qx/tool/{cli → compiler/cli}/api/CompilerApi.js +11 -10
  274. package/source/class/qx/tool/{cli → compiler/cli}/api/LibraryApi.js +13 -4
  275. package/source/class/qx/tool/{cli → compiler/cli}/api/Test.js +1 -1
  276. package/source/class/qx/tool/compiler/cli/commands/Add.js +49 -0
  277. package/source/class/qx/tool/{cli → compiler/cli}/commands/Clean.js +12 -25
  278. package/source/class/qx/tool/{cli → compiler/cli}/commands/Compile.js +524 -615
  279. package/source/class/qx/tool/{cli → compiler/cli}/commands/Config.js +22 -20
  280. package/source/class/qx/tool/{cli → compiler/cli}/commands/Create.js +77 -54
  281. package/source/class/qx/tool/{cli → compiler/cli}/commands/Deploy.js +45 -60
  282. package/source/class/qx/tool/{cli → compiler/cli}/commands/Es6ify.js +57 -41
  283. package/source/class/qx/tool/{cli → compiler/cli}/commands/ExportGlyphs.js +26 -7
  284. package/source/class/qx/tool/compiler/cli/commands/Lint.js +420 -0
  285. package/source/class/qx/tool/{cli → compiler/cli}/commands/Migrate.js +40 -20
  286. package/source/class/qx/tool/{cli → compiler/cli}/commands/Package.js +20 -32
  287. package/source/class/qx/tool/compiler/cli/commands/Pkg.js +36 -0
  288. package/source/class/qx/tool/compiler/cli/commands/Prettier.js +278 -0
  289. package/source/class/qx/tool/{cli → compiler/cli}/commands/Run.js +43 -39
  290. package/source/class/qx/tool/{cli → compiler/cli}/commands/Serve.js +63 -61
  291. package/source/class/qx/tool/{cli → compiler/cli}/commands/Test.js +49 -52
  292. package/source/class/qx/tool/{cli → compiler/cli}/commands/Typescript.js +51 -30
  293. package/source/class/qx/tool/{cli → compiler/cli}/commands/add/Class.js +54 -31
  294. package/source/class/qx/tool/{cli → compiler/cli}/commands/add/Script.js +56 -32
  295. package/source/class/qx/tool/{cli → compiler/cli}/commands/config/Delete.js +19 -13
  296. package/source/class/qx/tool/{cli → compiler/cli}/commands/config/Get.js +19 -13
  297. package/source/class/qx/tool/{cli → compiler/cli}/commands/config/List.js +20 -20
  298. package/source/class/qx/tool/{cli → compiler/cli}/commands/config/Set.js +28 -20
  299. package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Install.js +140 -75
  300. package/source/class/qx/tool/{cli → compiler/cli}/commands/package/List.js +119 -80
  301. package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Publish.js +194 -178
  302. package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Remove.js +18 -21
  303. package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Update.js +90 -69
  304. package/source/class/qx/tool/{cli → compiler/cli}/commands/package/Upgrade.js +67 -54
  305. package/source/class/qx/tool/compiler/makers/AbstractAppMaker.js +2 -1
  306. package/source/class/qx/tool/compiler/resources/Manager.js +2 -0
  307. package/source/class/qx/tool/compiler/resources/ScssConverter.js +1 -1
  308. package/source/class/qx/tool/compiler/resources/ScssFile.js +1 -1
  309. package/source/class/qx/tool/compiler/targets/Target.js +5 -10
  310. package/source/class/qx/tool/compiler/targets/TypeScriptWriter.js +6 -2
  311. package/source/class/qx/tool/compiler/targets/meta/ApplicationMeta.js +2 -4
  312. package/source/class/qx/tool/compiler/targets/meta/BootJs.js +2 -0
  313. package/source/class/qx/tool/compiler/targets/meta/PackageJavascript.js +2 -0
  314. package/source/class/qx/tool/config/Abstract.js +5 -5
  315. package/source/class/qx/tool/config/Lockfile.js +1 -1
  316. package/source/class/qx/tool/migration/BaseMigration.js +9 -7
  317. package/source/class/qx/tool/migration/M6_0_0.js +3 -3
  318. package/source/class/qx/tool/migration/M8_0_0.js +958 -0
  319. package/source/class/qx/tool/utils/Debounce.js +0 -1
  320. package/source/class/qx/tool/utils/Http.js +109 -21
  321. package/source/class/qx/tool/utils/LogManager.js +7 -0
  322. package/source/class/qx/tool/utils/Promisify.js +12 -1
  323. package/source/class/qx/tool/utils/QooxdooVersions.js +193 -0
  324. package/source/class/qx/tool/utils/Utils.js +8 -5
  325. package/source/class/qx/tool/utils/Website.js +9 -222
  326. package/source/class/qx/tool/utils/Zip.js +47 -0
  327. package/source/class/qx/tool/utils/files/Utils.js +3 -11
  328. package/source/class/qx/tool/utils/json/Tokenizer.js +5 -0
  329. package/source/class/qx/ui/basic/Atom.js +8 -8
  330. package/source/class/qx/ui/core/Blocker.js +17 -4
  331. package/source/class/qx/ui/core/DragDropCursor.js +2 -1
  332. package/source/class/qx/ui/core/EventHandler.js +13 -21
  333. package/source/class/qx/ui/core/LayoutItem.js +8 -31
  334. package/source/class/qx/ui/core/MExecutable.js +7 -31
  335. package/source/class/qx/ui/core/MNativeOverflow.js +4 -2
  336. package/source/class/qx/ui/core/Widget.js +50 -165
  337. package/source/class/qx/ui/core/scroll/IScrollBar.js +9 -3
  338. package/source/class/qx/ui/core/scroll/ScrollBar.js +7 -1
  339. package/source/class/qx/ui/core/scroll/ScrollPane.js +12 -4
  340. package/source/class/qx/ui/embed/Html.js +6 -2
  341. package/source/class/qx/ui/form/AbstractField.js +4 -12
  342. package/source/class/qx/ui/form/Button.js +6 -4
  343. package/source/class/qx/ui/form/CheckedSelectBox.js +8 -8
  344. package/source/class/qx/ui/form/FileSelectorButton.js +1 -1
  345. package/source/class/qx/ui/form/Form.js +3 -0
  346. package/source/class/qx/ui/form/IListItem.js +3 -1
  347. package/source/class/qx/ui/form/IRadioItem.js +3 -1
  348. package/source/class/qx/ui/form/MForm.js +3 -1
  349. package/source/class/qx/ui/form/Slider.js +6 -2
  350. package/source/class/qx/ui/form/SplitButton.js +5 -5
  351. package/source/class/qx/ui/form/TextField.js +1 -2
  352. package/source/class/qx/ui/form/validation/Manager.js +6 -2
  353. package/source/class/qx/ui/menubar/Button.js +1 -1
  354. package/source/class/qx/ui/mobile/basic/Atom.js +5 -5
  355. package/source/class/qx/ui/mobile/dialog/Menu.js +9 -31
  356. package/source/class/qx/ui/mobile/dialog/Popup.js +13 -1
  357. package/source/class/qx/ui/table/pane/FocusIndicator.js +5 -2
  358. package/source/class/qx/ui/table/pane/Scroller.js +5 -20
  359. package/source/class/qx/ui/table/selection/Model.js +1 -0
  360. package/source/class/qx/ui/toolbar/Button.js +1 -1
  361. package/source/class/qx/ui/toolbar/CheckBox.js +1 -1
  362. package/source/class/qx/ui/toolbar/FileSelectorButton.js +1 -2
  363. package/source/class/qx/ui/toolbar/Part.js +2 -2
  364. package/source/class/qx/ui/toolbar/PartContainer.js +2 -2
  365. package/source/class/qx/ui/toolbar/ToolBar.js +24 -49
  366. package/source/class/qx/ui/tree/VirtualTree.js +6 -4
  367. package/source/class/qx/ui/tree/core/AbstractItem.js +10 -17
  368. package/source/class/qx/ui/tree/core/IVirtualTree.js +4 -2
  369. package/source/class/qx/ui/tree/provider/IVirtualTreeProvider.js +20 -10
  370. package/source/class/qx/ui/treevirtual/SimpleTreeDataModel.js +4 -1
  371. package/source/class/qx/ui/virtual/cell/Cell.js +20 -48
  372. package/source/class/qx/ui/virtual/cell/WidgetCell.js +2 -4
  373. package/source/class/qx/ui/virtual/core/Axis.js +4 -0
  374. package/source/class/qx/ui/virtual/core/ILayer.js +14 -10
  375. package/source/class/qx/ui/virtual/core/Scroller.js +4 -4
  376. package/source/class/qx/ui/virtual/layer/WidgetCell.js +4 -0
  377. package/source/class/qx/ui/virtual/selection/Abstract.js +3 -0
  378. package/source/class/qx/ui/virtual/selection/MModel.js +1 -1
  379. package/source/class/qx/ui/window/IDesktop.js +6 -2
  380. package/source/class/qx/ui/window/IWindowManager.js +10 -4
  381. package/source/class/qx/ui/window/MDesktop.js +2 -1
  382. package/source/class/qx/ui/window/Manager.js +1 -1
  383. package/source/class/qx/ui/window/Window.js +6 -4
  384. package/source/class/qx/util/OOUtil.js +8 -9
  385. package/source/class/qx/util/PropertyUtil.js +34 -154
  386. package/source/class/qx/util/ResponseParser.js +2 -0
  387. package/source/class/qx/util/Serializer.js +69 -114
  388. package/source/class/qx/util/format/DateFormat.js +3 -2
  389. package/source/global.d.ts +4 -0
  390. package/source/resource/qx/tool/bin/download-assets +0 -2
  391. package/source/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-node.tmpl.js +1 -0
  392. package/{lib/resource/qx/tool → source/resource/qx/tool/compiler}/cli/templates/template_vars.js +12 -9
  393. package/{lib/resource/qx/tool → source/resource/qx/tool/compiler}/schema/Manifest-1-0-0.json +2 -2
  394. package/source/resource/qx/tool/{schema → compiler/schema}/Manifest-2-0-0.json +2 -2
  395. package/source/resource/qx/tool/{schema → compiler/schema}/compile-1-0-0.json +15 -3
  396. package/{lib/resource/qx/tool → source/resource/qx/tool/compiler}/schema/qooxdoo-1-0-0.json +1 -1
  397. package/source/resource/qx/tool/website/build/404.html +22 -22
  398. package/source/resource/qx/tool/website/build/about.html +23 -23
  399. package/source/resource/qx/tool/website/build/assets/common.js +30 -18
  400. package/source/resource/qx/tool/website/build/assets/custom.css +290 -0
  401. package/source/resource/qx/tool/website/build/assets/qxWeb.js +28 -0
  402. package/source/resource/qx/tool/website/build/diagnostics/dependson.html +30 -30
  403. package/source/resource/qx/tool/website/build/diagnostics/dependson.js +49 -40
  404. package/source/resource/qx/tool/website/build/diagnostics/requiredby.html +20 -23
  405. package/source/resource/qx/tool/website/build/diagnostics/requiredby.js +38 -31
  406. package/source/resource/qx/tool/website/build/index.html +24 -24
  407. package/source/resource/qx/tool/website/build/scripts/serve.js +63 -65
  408. package/source/resource/qx/tool/website/partials/footer.html +8 -13
  409. package/source/resource/qx/tool/website/partials/head.html +9 -7
  410. package/source/resource/qx/tool/website/partials/header.html +3 -3
  411. package/source/resource/qx/tool/website/src/assets/common.js +32 -0
  412. package/source/resource/qx/tool/website/src/assets/custom.css +290 -0
  413. package/source/resource/qx/tool/website/src/assets/qxWeb.js +28 -0
  414. package/source/resource/qx/tool/website/src/diagnostics/dependson.js +49 -40
  415. package/source/resource/qx/tool/website/src/diagnostics/requiredby.js +38 -31
  416. package/source/resource/qx/tool/website/src/index.html +2 -2
  417. package/source/resource/qx/tool/website/src/scripts/serve.js +63 -65
  418. package/lib/resource/qx/tool/bin/build-devtools +0 -13
  419. package/lib/resource/qx/tool/bin/build-website +0 -15
  420. package/lib/resource/qx/tool/bin/download-assets +0 -23
  421. package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +0 -1
  422. package/lib/resource/qx/tool/website/build/assets/bootstrap.css +0 -7
  423. package/lib/resource/qx/tool/website/build/assets/bootstrap.min.css +0 -7
  424. package/lib/resource/qx/tool/website/build/assets/bootstrap.min.css.map +0 -1
  425. package/lib/resource/qx/tool/website/build/assets/jquery.js +0 -5453
  426. package/lib/resource/qx/tool/website/build/qooxdoo.css +0 -21
  427. package/lib/resource/qx/tool/website/sass/qooxdoo.css +0 -3
  428. package/lib/resource/qx/tool/website/sass/qooxdoo.css.map +0 -1
  429. package/lib/resource/qx/tool/website/src/assets/bootstrap.css +0 -7
  430. package/lib/resource/qx/tool/website/src/assets/bootstrap.min.css +0 -7
  431. package/lib/resource/qx/tool/website/src/assets/bootstrap.min.css.map +0 -1
  432. package/lib/resource/qx/tool/website/src/assets/jquery.js +0 -5453
  433. package/source/class/qx/core/Property.js +0 -2100
  434. package/source/class/qx/tool/cli/Application.js +0 -47
  435. package/source/class/qx/tool/cli/Cli.js +0 -713
  436. package/source/class/qx/tool/cli/commands/Add.js +0 -46
  437. package/source/class/qx/tool/cli/commands/Lint.js +0 -255
  438. package/source/class/qx/tool/cli/commands/Pkg.js +0 -56
  439. package/source/class/qx/tool/cli/commands/package/Migrate.js +0 -37
  440. package/source/class/qx/tool/compiler/app/Cldr.js +0 -725
  441. package/source/resource/qx/tool/bin/build-devtools +0 -13
  442. package/source/resource/qx/tool/bin/build-website +0 -15
  443. package/source/resource/qx/tool/website/build/assets/bootstrap.css +0 -7
  444. package/source/resource/qx/tool/website/build/assets/bootstrap.min.css +0 -7
  445. package/source/resource/qx/tool/website/build/assets/bootstrap.min.css.map +0 -1
  446. package/source/resource/qx/tool/website/build/assets/jquery.js +0 -5453
  447. package/source/resource/qx/tool/website/build/qooxdoo.css +0 -21
  448. package/source/resource/qx/tool/website/sass/qooxdoo.scss +0 -31
  449. package/source/resource/qx/tool/website/src/assets/bootstrap.css +0 -7
  450. package/source/resource/qx/tool/website/src/assets/bootstrap.min.css +0 -7
  451. package/source/resource/qx/tool/website/src/assets/bootstrap.min.css.map +0 -1
  452. package/source/resource/qx/tool/website/src/assets/jquery.js +0 -5453
  453. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/TypeScriptWriter-base_declaration.d.ts +0 -0
  454. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/default.tmpl.js +0 -0
  455. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/header.tmpl.js +0 -0
  456. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/interface.tmpl.js +0 -0
  457. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/mixin.tmpl.js +0 -0
  458. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/class/singleton.tmpl.js +0 -0
  459. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-browser.tmpl.js +0 -0
  460. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-rhino.tmpl.js +0 -0
  461. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/.gitignore.tmpl +0 -0
  462. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/Manifest.tmpl.json +0 -0
  463. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/compile.tmpl.json +0 -0
  464. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/readme.tmpl.md +0 -0
  465. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/boot/index.tmpl.html +0 -0
  466. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/boot/nojs.tmpl.html +0 -0
  467. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/Application.tmpl.js +0 -0
  468. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/__init__.tmpl.js +0 -0
  469. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/test/DemoTest.tmpl.js +0 -0
  470. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Appearance.tmpl.js +0 -0
  471. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Color.tmpl.js +0 -0
  472. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Decoration.tmpl.js +0 -0
  473. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Font.tmpl.js +0 -0
  474. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Theme.tmpl.js +0 -0
  475. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/app.png +0 -0
  476. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/favicon.png +0 -0
  477. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/js_256x256.png +0 -0
  478. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/test.png +0 -0
  479. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/translation/readme.txt +0 -0
  480. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/.gitignore.tmpl +0 -0
  481. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/Manifest.tmpl.json +0 -0
  482. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/compile.tmpl.json +0 -0
  483. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/readme.tmpl.md +0 -0
  484. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/boot/index.tmpl.html +0 -0
  485. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/boot/nojs.tmpl.html +0 -0
  486. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/Application.tmpl.js +0 -0
  487. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/__init__.tmpl.js +0 -0
  488. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js +0 -0
  489. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/Overview.tmpl.js +0 -0
  490. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/__init__.tmpl.js +0 -0
  491. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/app.png +0 -0
  492. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/css/.gitignore.tmpl +0 -0
  493. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/favicon.png +0 -0
  494. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/js_256x256.png +0 -0
  495. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/theme/custom/css/custom.css +0 -0
  496. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/translation/readme.txt +0 -0
  497. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/.gitignore.tmpl +0 -0
  498. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/Manifest.tmpl.json +0 -0
  499. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/compile.tmpl.json +0 -0
  500. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/readme.tmpl.md +0 -0
  501. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/Button.tmpl.js +0 -0
  502. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/__init__.tmpl.js +0 -0
  503. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/demo/Application.tmpl.js +0 -0
  504. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/resource/custom/test.png +0 -0
  505. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/test/DemoTest.tmpl.js +0 -0
  506. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Appearance.tmpl.js +0 -0
  507. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Color.tmpl.js +0 -0
  508. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Decoration.tmpl.js +0 -0
  509. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Font.tmpl.js +0 -0
  510. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Theme.tmpl.js +0 -0
  511. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/resource/custom/test.png +0 -0
  512. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/translation/readme.txt +0 -0
  513. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/.gitignore.tmpl +0 -0
  514. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/Manifest.tmpl.json +0 -0
  515. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/compile.tmpl.json +0 -0
  516. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/readme.tmpl.txt +0 -0
  517. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/Application.tmpl.js +0 -0
  518. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/__init__.tmpl.js +0 -0
  519. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/test/DemoTest.tmpl.js +0 -0
  520. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/resource/custom/.gitignore.tmpl +0 -0
  521. /package/lib/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/translation/readme.txt +0 -0
  522. /package/lib/resource/qx/tool/{loadsass.js → compiler/loadsass.js} +0 -0
  523. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/TypeScriptWriter-base_declaration.d.ts +0 -0
  524. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/default.tmpl.js +0 -0
  525. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/header.tmpl.js +0 -0
  526. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/interface.tmpl.js +0 -0
  527. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/mixin.tmpl.js +0 -0
  528. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/class/singleton.tmpl.js +0 -0
  529. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-browser.tmpl.js +0 -0
  530. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/loader/loader-rhino.tmpl.js +0 -0
  531. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/.gitignore.tmpl +0 -0
  532. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/Manifest.tmpl.json +0 -0
  533. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/compile.tmpl.json +0 -0
  534. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/readme.tmpl.md +0 -0
  535. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/boot/index.tmpl.html +0 -0
  536. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/boot/nojs.tmpl.html +0 -0
  537. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/Application.tmpl.js +0 -0
  538. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/__init__.tmpl.js +0 -0
  539. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/test/DemoTest.tmpl.js +0 -0
  540. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Appearance.tmpl.js +0 -0
  541. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Color.tmpl.js +0 -0
  542. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Decoration.tmpl.js +0 -0
  543. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Font.tmpl.js +0 -0
  544. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/class/custom/theme/Theme.tmpl.js +0 -0
  545. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/app.png +0 -0
  546. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/favicon.png +0 -0
  547. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/js_256x256.png +0 -0
  548. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/resource/custom/test.png +0 -0
  549. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/desktop/source/translation/readme.txt +0 -0
  550. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/.gitignore.tmpl +0 -0
  551. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/Manifest.tmpl.json +0 -0
  552. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/compile.tmpl.json +0 -0
  553. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/readme.tmpl.md +0 -0
  554. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/boot/index.tmpl.html +0 -0
  555. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/boot/nojs.tmpl.html +0 -0
  556. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/Application.tmpl.js +0 -0
  557. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/__init__.tmpl.js +0 -0
  558. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js +0 -0
  559. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/Overview.tmpl.js +0 -0
  560. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/class/custom/page/__init__.tmpl.js +0 -0
  561. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/app.png +0 -0
  562. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/css/.gitignore.tmpl +0 -0
  563. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/favicon.png +0 -0
  564. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/resource/custom/js_256x256.png +0 -0
  565. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/theme/custom/scss/_styles.scss +0 -0
  566. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/theme/custom/scss/custom.scss +0 -0
  567. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/mobile/source/translation/readme.txt +0 -0
  568. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/.gitignore.tmpl +0 -0
  569. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/Manifest.tmpl.json +0 -0
  570. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/compile.tmpl.json +0 -0
  571. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/readme.tmpl.md +0 -0
  572. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/Button.tmpl.js +0 -0
  573. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/__init__.tmpl.js +0 -0
  574. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/demo/Application.tmpl.js +0 -0
  575. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/resource/custom/test.png +0 -0
  576. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/test/DemoTest.tmpl.js +0 -0
  577. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Appearance.tmpl.js +0 -0
  578. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Color.tmpl.js +0 -0
  579. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Decoration.tmpl.js +0 -0
  580. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Font.tmpl.js +0 -0
  581. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/class/custom/theme/Theme.tmpl.js +0 -0
  582. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/resource/custom/test.png +0 -0
  583. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/package/source/translation/readme.txt +0 -0
  584. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/.gitignore.tmpl +0 -0
  585. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/Manifest.tmpl.json +0 -0
  586. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/compile.tmpl.json +0 -0
  587. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/readme.tmpl.txt +0 -0
  588. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/Application.tmpl.js +0 -0
  589. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/__init__.tmpl.js +0 -0
  590. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/class/custom/test/DemoTest.tmpl.js +0 -0
  591. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/resource/custom/.gitignore.tmpl +0 -0
  592. /package/source/resource/qx/tool/{cli → compiler/cli}/templates/skeleton/server/source/translation/readme.txt +0 -0
  593. /package/source/resource/qx/tool/{loadsass.js → compiler/loadsass.js} +0 -0
@@ -19,15 +19,420 @@
19
19
  /**
20
20
  * @ignore(qx.Node, qx.test.A, qx.test.B, qx.test.clName, qx.test.IForm)
21
21
  * @ignore(qx.TestProperty, qx.Super)
22
+ * @ignore(qx.test.cpnfv8.*)
22
23
  */
23
24
 
24
25
  qx.Class.define("qx.test.core.Property", {
25
26
  extend: qx.dev.unit.TestCase,
27
+ include: [qx.test.io.MAssert],
26
28
 
27
29
  members: {
28
- testBasic() {
29
- this.assertNotUndefined(qx.core.Property);
30
+ setUp() {
31
+ qx.core.Environment.set("qx.core.property.Property.excludeAutoApply", []);
32
+ qx.core.Environment.set("qx.core.property.Property.applyDuringConstruct", true);
33
+ qx.core.Environment.set("qx.core.property.Property.allowDeferredInit", false);
34
+
35
+ qx.Class.define("qx.test.cpnfv8.Object", {
36
+ extend: qx.core.Object
37
+ });
38
+
39
+ qx.Class.define("qx.test.cpnfv8.Superclass", {
40
+ extend: qx.test.cpnfv8.Object,
41
+
42
+ construct(bRunning = true) {
43
+ super();
44
+ console.log(`Superclass constructor: bRunning=${bRunning}`);
45
+ this.running = bRunning;
46
+ },
47
+
48
+ properties: {
49
+ running: {
50
+ init: undefined,
51
+ check: "Boolean",
52
+ event: "changeRunning",
53
+ apply: "_applyXxx",
54
+ isEqual(a, b) {
55
+ return a === b;
56
+ }
57
+ },
58
+
59
+ nullableProp: {
60
+ init: 10,
61
+ check: "Number",
62
+ nullable: true,
63
+ apply: "_applyXxx"
64
+ },
65
+
66
+ nonNullableProp: {
67
+ init: 10,
68
+ check: "Number",
69
+ nullable: false
70
+ },
71
+
72
+ jsdocProp: {
73
+ initFunction: () => [10, 20, 30],
74
+ check: "Array<Number>"
75
+ },
76
+
77
+ anyProp: {
78
+ init: null,
79
+ nullable: true,
80
+ apply: "_applyXxx"
81
+ },
82
+
83
+ asyncProp: {
84
+ init: null,
85
+ nullable: true,
86
+ check: "Number"
87
+ },
88
+
89
+ promiseProp: {
90
+ check: "Promise"
91
+ },
92
+
93
+ mustBe42: {
94
+ init: 0,
95
+ check: v => v === 42
96
+ },
97
+
98
+ positive: {
99
+ init: 1,
100
+ check: "Number",
101
+ validate(value) {
102
+ if (value <= 0) {
103
+ throw new Error("value must be greater than 0");
104
+ }
105
+ }
106
+ },
107
+
108
+ readOnly: {
109
+ initFunction: () => 42,
110
+ immutable: "readonly"
111
+ }
112
+ },
113
+
114
+ members: {
115
+ lastApply: null,
116
+ applyCount: 0,
117
+ num: 23,
118
+ str: "hello world",
119
+
120
+ publicMethod() {
121
+ console.log("superclass publicMethod called");
122
+ },
123
+
124
+ _applyXxx(value, old) {
125
+ if (qx.core.Environment.get("qx.core.property.Property.applyDuringConstruct")) {
126
+ if (value === old) {
127
+ throw new Error("superclass: _applyXxx called with identical value");
128
+ }
129
+ }
130
+ this.lastApply = [value, old];
131
+ this.applyCount++;
132
+
133
+ console.log(`superclass apply running: value changing from ${old} to ${value}`);
134
+ }
135
+ }
136
+ });
137
+
138
+ qx.Bootstrap.define("qx.test.cpnfv8.ExternalStorage", {
139
+ extend: Object,
140
+ implement: qx.core.property.IPropertyStorage,
141
+
142
+ members: {
143
+ /**@override */
144
+ init(prop, property) {
145
+ qx.test.cpnfv8.ExternalStorage._subclassStorage = {
146
+ externallyStored: 0
147
+ };
148
+ },
149
+
150
+ /**@override */
151
+ getAsync() {},
152
+
153
+ /**@override */
154
+ setAsync() {},
155
+
156
+ /**@override */
157
+ reset(thisObj, property, value) {
158
+ console.log("in externallyStored reset");
159
+ qx.test.cpnfv8.ExternalStorage._subclassStorage[property.getPropertyName()] = value;
160
+ },
161
+
162
+ /**@override */
163
+ isAsyncStorage() {
164
+ return false;
165
+ },
166
+
167
+ /**@override */
168
+ get(thisObj, prop) {
169
+ console.log("in externallyStored getter");
170
+ return qx.test.cpnfv8.ExternalStorage._subclassStorage[prop.getPropertyName()];
171
+ },
172
+
173
+ /**@override */
174
+ set(thisObj, property, value) {
175
+ console.log("in externallyStored setter");
176
+ qx.test.cpnfv8.ExternalStorage._subclassStorage[property.getPropertyName()] = value;
177
+ },
178
+
179
+ /**@override */
180
+ dereference(prop, property) {}
181
+ },
182
+
183
+ statics: {
184
+ _subclassStorage: {}
185
+ }
186
+ });
187
+
188
+ qx.Class.define("qx.test.cpnfv8.Subclass", {
189
+ extend: qx.test.cpnfv8.Superclass,
190
+
191
+ construct(num, bRunning) {
192
+ console.log(`Subclass constructor: num=${num} bRunning=${bRunning}`);
193
+ super(bRunning); // super();
194
+ this.initExternallyStored();
195
+ this.num = num;
196
+ this.publicMethod();
197
+ },
198
+
199
+ statics: {
200
+ staticEntry: "I am static"
201
+ },
202
+
203
+ members: {
204
+ publicMethod() {
205
+ console.log("subclass publicMethod called");
206
+ super.publicMethod();
207
+ },
208
+
209
+ _applyRunning(value, old) {
210
+ console.log(`subclass apply running: value changing from ${old} to ${value}`);
211
+
212
+ super._applyRunning(value, old);
213
+ }
214
+ },
215
+
216
+ properties: {
217
+ externallyStored: {
218
+ init: 10,
219
+ storage: qx.test.cpnfv8.ExternalStorage
220
+ },
221
+ nullableProp: {
222
+ refine: true,
223
+ init: 12
224
+ },
225
+ delay: {
226
+ init: 0,
227
+ async: true,
228
+ getAsync: async (prop, self) => {
229
+ let p;
230
+ p = new qx.Promise((resolve, reject) => {
231
+ setTimeout(() => {
232
+ resolve(true);
233
+ }, 1200);
234
+ });
235
+ return p;
236
+ },
237
+ apply(value, oldValue) {
238
+ this.applyCount++;
239
+ this.lastApply = [value, oldValue];
240
+ return new qx.Promise((resolve, reject) => {
241
+ setTimeout(() => {
242
+ resolve(true);
243
+ }, 1200);
244
+ });
245
+ }
246
+ }
247
+ }
248
+ });
249
+
250
+ //
251
+ // Simulate qx.data.Array to demonstrate native-like access to array elements
252
+ //
253
+ qx.Class.define("qx.test.cpnfv8.Arr", {
254
+ extend: qx.test.cpnfv8.Object,
255
+
256
+ // Show how qx.data.Array could be indexed rather than getItem()
257
+ delegate: {
258
+ get(prop) {
259
+ // If the property is a number or string representing a number...
260
+ if (+prop === +prop) {
261
+ // ... then use the method for retrieving an item
262
+ return this.getItem(prop);
263
+ } else {
264
+ // otherwise, use the default action
265
+ return this[prop];
266
+ }
267
+ },
268
+
269
+ set(prop, value) {
270
+ // If the property is a number or string representing a number...
271
+ if (+prop === +prop) {
272
+ // ... then use the method for modifying an item
273
+ this.setItem(prop, value);
274
+ } else {
275
+ // otherwise, use the default action
276
+ this[prop] = value;
277
+ }
278
+ },
279
+
280
+ delete(prop) {
281
+ this.remove(prop);
282
+ }
283
+ },
284
+
285
+ properties: {
286
+ arr: {
287
+ initFunction(key) {
288
+ console.log(`Allocating a new array object for property '${key}'`);
289
+
290
+ return [];
291
+ }
292
+ }
293
+ },
294
+
295
+ construct() {
296
+ super();
297
+ for (let i = 0; i < 3; i++) {
298
+ this.setItem(i, "Item " + i);
299
+ }
300
+ },
301
+
302
+ members: {
303
+ getItem(i) {
304
+ return this.getArr()[i];
305
+ },
306
+
307
+ setItem(i, value) {
308
+ this.getArr()[i] = value;
309
+ },
310
+
311
+ remove(i) {
312
+ var index = i in this.getArr() ? i : -1;
313
+
314
+ if (index != -1) {
315
+ this.getArr().splice(index, 1);
316
+ return i;
317
+ }
318
+
319
+ return undefined;
320
+ }
321
+ }
322
+ });
323
+
324
+ qx.Class.define("qx.test.cpnfv8.Singleton", {
325
+ type: "singleton",
326
+ extend: qx.test.cpnfv8.Superclass,
327
+
328
+ construct() {
329
+ super(true);
330
+ console.log(`constructor displayname: ${this.constructor.$$displayName}`);
331
+
332
+ console.log(`instance displayname: ${this.$$displayName}`);
333
+ }
334
+ });
335
+
336
+ qx.Class.define("qx.test.cpnfv8.Abstract", {
337
+ type: "abstract",
338
+ extend: qx.test.cpnfv8.Superclass,
339
+
340
+ construct() {
341
+ super(true);
342
+ console.log(`$displayname: ${this.$$displayName}`);
343
+ },
344
+
345
+ members: {
346
+ doSomething() {
347
+ throw new Error(`${this.$$displayName} is abstract}`);
348
+ }
349
+ }
350
+ });
351
+
352
+ qx.Class.define("qx.test.cpnfv8.SubclassOfAbstract", {
353
+ extend: qx.test.cpnfv8.Abstract,
354
+
355
+ environment: {
356
+ "qx.test.cpnfv8.greeting": "hi there"
357
+ },
358
+
359
+ properties: {
360
+ recentGreeting: {
361
+ check: "String",
362
+ init: "uninitialized"
363
+ }
364
+ },
365
+
366
+ events: {
367
+ myNormalEvent: "qx.event.type.Event",
368
+ myDataEvent: "qx.event.type.Data"
369
+ },
370
+
371
+ members: {
372
+ getGreeting() {
373
+ this.recentGreeting = qx.core.Environment.get("qx.test.cpnfv8.greeting");
374
+
375
+ return this.getRecentGreeting();
376
+ }
377
+ },
378
+
379
+ defer(clazz, members, properties) {
380
+ // console.log("Class keys:");
381
+ // Object.keys(clazz).forEach((key) => console.log(`\t${key}`));
382
+ // console.log("Member keys:");
383
+ // Object.keys(members).forEach((key) => console.log(`\t${key}`));
384
+ // console.log("Propeties:");
385
+ // console.log(JSON.stringify(properties, null, " "));
386
+ }
387
+ });
388
+
389
+ qx.Class.define("qx.test.cpnfv8.ImmutableArray", {
390
+ extend: qx.test.cpnfv8.Object,
391
+
392
+ properties: {
393
+ a: {
394
+ check: "Array",
395
+ initFunction: () => [],
396
+ storage: qx.core.property.ImmutableArrayStorage
397
+ }
398
+ }
399
+ });
400
+
401
+ qx.Class.define("qx.test.cpnfv8.ImmutableObject", {
402
+ extend: qx.test.cpnfv8.Object,
403
+
404
+ properties: {
405
+ a: {
406
+ check: "Object",
407
+ initFunction: () => {
408
+ let ret = {};
409
+ return ret;
410
+ },
411
+ immutable: "replace"
412
+ // storage : qx.core.property.ImmutableObjectStorage // same as immutable:"replace"
413
+ }
414
+ }
415
+ });
416
+ },
30
417
 
418
+ tearDown() {
419
+ qx.core.Environment.reset("qx.core.property.Property.excludeAutoApply");
420
+ qx.core.Environment.reset("qx.core.property.Property.applyDuringConstruct");
421
+ qx.core.Environment.reset("qx.core.property.Property.allowDeferredInit");
422
+ qx.Class.undefine("qx.test.cpnfv8.Object");
423
+ qx.Class.undefine("qx.test.cpnfv8.Superclass");
424
+ qx.Class.undefine("qx.test.cpnfv8.ExternalStorage");
425
+ qx.Class.undefine("qx.test.cpnfv8.Subclass");
426
+ qx.Class.undefine("qx.test.cpnfv8.Arr");
427
+ qx.Class.undefine("qx.test.cpnfv8.Singleton");
428
+ qx.Class.undefine("qx.test.cpnfv8.Abstract");
429
+ qx.Class.undefine("qx.test.cpnfv8.SubclassOfAbstract");
430
+ qx.Class.undefine("qx.test.cpnfv8.ImmutableArray");
431
+ qx.Class.undefine("qx.test.cpnfv8.ImmutableObject");
432
+ qx.Class.undefine("qx.test.cpnfv8.ToBeUndefined");
433
+ },
434
+
435
+ testBasic() {
31
436
  // Check instance
32
437
  var inst = new qx.test.core.PropertyHelper();
33
438
  this.assertNotUndefined(inst, "instance");
@@ -45,13 +450,10 @@ qx.Class.define("qx.test.core.Property", {
45
450
  },
46
451
 
47
452
  testBuiltinTypes() {
48
- this.assertNotUndefined(qx.core.Property);
49
-
50
453
  // Check instance
51
454
  var inst = new qx.test.core.PropertyHelper();
52
455
  this.assertNotUndefined(inst, "instance");
53
456
 
54
- // Type checks: String
55
457
  this.assertIdentical(
56
458
  "Hello",
57
459
  inst.setStringProp("Hello"),
@@ -136,9 +538,52 @@ qx.Class.define("qx.test.core.Property", {
136
538
  inst.dispose();
137
539
  },
138
540
 
139
- testInheritance() {
140
- this.assertNotUndefined(qx.core.Property);
541
+ testApply() {
542
+ let obj = new qx.test.cpnfv8.Superclass();
543
+ this.assertEquals(3, obj.applyCount, "initial apply count should be 3");
544
+ this.assertArrayEquals([null, undefined], obj.lastApply, "last apply call during construction");
545
+ obj.setRunning(false);
546
+ this.assertArrayEquals([false, true], obj.lastApply, "apply called with correct args");
547
+ this.assertEquals(4, obj.applyCount, "apply count 1");
548
+ obj.setAnyProp(null);
549
+ this.assertEquals(4, obj.applyCount, "apply count should not change");
550
+ obj.setAnyProp("juhu");
551
+ this.assertArrayEquals(["juhu", null], obj.lastApply, "apply called with correct args 2");
552
+ this.assertEquals(5, obj.applyCount, "apply count 2");
553
+
554
+ obj.resetAnyProp();
555
+ this.assertArrayEquals([null, "juhu"], obj.lastApply, "apply called with correct args 3");
556
+ this.assertEquals(6, obj.applyCount, "apply count 3");
557
+ this.assertNull(obj.getAnyProp(), "getAnyProp after reset should return null");
558
+
559
+ obj.resetRunning();
560
+ try {
561
+ obj.getRunning();
562
+ this.fail("getAnyProp should throw an error if no init value is set");
563
+ } catch (e) {}
564
+
565
+ obj.setRunning(true);
566
+ this.assertArrayEquals([true, undefined], obj.lastApply, "apply called with correct args 4");
567
+
568
+ obj.dispose();
569
+
570
+ obj = new qx.test.cpnfv8.Subclass(23, true);
571
+ this.assertEquals(4, obj.applyCount, "all properties should be initialized, including inherited ones");
572
+ obj.dispose();
573
+
574
+ //old, deprecated behaviour
575
+ qx.core.Environment.set("qx.core.property.Property.applyDuringConstruct", false);
576
+ obj = new qx.test.cpnfv8.Superclass();
577
+ this.assertEquals(1, obj.applyCount, "old behaviour: initial apply count should be 1");
578
+ obj.resetAnyProp();
579
+ this.assertEquals(1, obj.applyCount, "old behaviour: apply count after reset should still be 1");
580
+ obj.setAnyProp(null);
581
+ this.assertEquals(2, obj.applyCount, "old behaviour: apply count should be 2 after setting a value");
582
+ this.assertArrayEquals([null, null], obj.lastApply, "old behaviour: last apply call during construction");
583
+ qx.core.Environment.reset("qx.core.property.Property.applyDuringConstruct");
584
+ },
141
585
 
586
+ testInheritance() {
142
587
  var pa = new qx.test.core.InheritanceDummy();
143
588
  var ch1 = new qx.test.core.InheritanceDummy();
144
589
  var ch2 = new qx.test.core.InheritanceDummy();
@@ -146,16 +591,28 @@ qx.Class.define("qx.test.core.Property", {
146
591
  var chh1 = new qx.test.core.InheritanceDummy();
147
592
  var chh2 = new qx.test.core.InheritanceDummy();
148
593
  var chh3 = new qx.test.core.InheritanceDummy();
594
+ let ch4 = new qx.test.core.InheritanceDummy();
595
+
596
+ ch4.setEnabled(true);
597
+ this.assertEquals(0, ch2.applyCount, "ch2 initial apply count");
598
+ this.assertEquals(1, ch4.applyCount, "ch4 initial apply count");
599
+ this.assertArrayEquals([true, undefined], ch4.lastApply, "ch4 initial apply args");
149
600
 
150
601
  pa.add(ch1);
151
602
  pa.add(ch2);
152
603
  pa.add(ch3);
604
+ pa.add(ch4);
153
605
  ch2.add(chh1);
154
606
  ch2.add(chh2);
155
607
  ch2.add(chh3);
156
608
 
157
609
  // Simple: Only inheritance, no local values
158
610
  this.assertTrue(pa.setEnabled(true), "a1");
611
+ this.assertArrayEquals([true, undefined], ch2.lastApply, "ch2 initial apply args");
612
+ this.assertEquals(1, ch2.applyCount, "ch2 initial apply count");
613
+ this.assertEquals(1, ch2.eventCount, "ch2 initial event count");
614
+ ch2.setEnabled("inherit");
615
+ this.assertEquals(1, ch2.eventCount, "ch2 event count after inherit set explicitly");
159
616
  this.assertTrue(pa.getEnabled(), "a2");
160
617
  this.assertTrue(ch1.getEnabled(), "a3");
161
618
  this.assertTrue(ch2.getEnabled(), "a4");
@@ -163,21 +620,39 @@ qx.Class.define("qx.test.core.Property", {
163
620
  this.assertTrue(chh1.getEnabled(), "a6");
164
621
  this.assertTrue(chh2.getEnabled(), "a7");
165
622
  this.assertTrue(chh3.getEnabled(), "a8");
623
+ this.assertEquals(1, ch4.applyCount, "ch4 apply count after parent change");
166
624
 
167
625
  // Enabling local value
168
626
  this.assertFalse(ch2.setEnabled(false), "b1");
627
+ this.assertEquals(2, ch2.applyCount, "ch2 apply count after parent change");
628
+ this.assertArrayEquals([false, true], ch2.lastApply, "ch2 last apply after change");
629
+ this.assertEquals(2, ch2.eventCount, "ch2 event count after parent change");
169
630
  this.assertFalse(ch2.getEnabled(), "b2");
170
631
  this.assertFalse(chh1.getEnabled(), "b3");
171
632
  this.assertFalse(chh2.getEnabled(), "b4");
172
633
  this.assertFalse(chh3.getEnabled(), "b5");
173
634
 
174
635
  // Reset local value
636
+ this.assertEquals(2, chh1.applyCount, "chh1 apply count before parent value change");
175
637
  ch2.resetEnabled();
176
638
  this.assertTrue(ch2.getEnabled(), "c2");
639
+ this.assertEquals(3, chh1.applyCount, "chh1 apply count after parent value change");
177
640
  this.assertTrue(chh1.getEnabled(), "c3");
178
641
  this.assertTrue(chh2.getEnabled(), "c4");
179
642
  this.assertTrue(chh3.getEnabled(), "c5");
180
643
 
644
+ this.assertEquals(3, ch2.applyCount, "ch2 apply count before parent value change such that it matches child");
645
+ ch2.setEnabled(false);
646
+ pa.setEnabled(false);
647
+ this.assertEquals(4, ch2.applyCount, "ch2 apply count after parent value change such that it matches child");
648
+
649
+ pa.setEnabled(true);
650
+ this.assertFalse(chh1.getEnabled(), "d2");
651
+ ch2.setEnabled("inherit");
652
+ this.assertArrayEquals([true, false], ch2.lastApply, "d3");
653
+ this.assertTrue(ch2.getEnabled(), "c2");
654
+ this.assertTrue(chh1.getEnabled(), "c2");
655
+
181
656
  pa.dispose();
182
657
  ch1.dispose();
183
658
  ch2.dispose();
@@ -187,44 +662,104 @@ qx.Class.define("qx.test.core.Property", {
187
662
  chh3.dispose();
188
663
  },
189
664
 
190
- testParent() {
191
- var pa = new qx.test.core.InheritanceDummy();
192
- var ch1 = new qx.test.core.InheritanceDummy();
193
- var ch2 = new qx.test.core.InheritanceDummy();
194
- var ch3 = new qx.test.core.InheritanceDummy();
665
+ testInheritanceInitValue() {
666
+ let pa = new qx.test.core.InheritanceDummy();
667
+ try {
668
+ pa.getEnabled();
669
+ this.fail("getEnabled should throw an error if no init value is set");
670
+ } catch (e) {}
195
671
 
196
- this.assertIdentical(pa.getEnabled(), null, "d1");
197
- this.assertIdentical(ch1.getEnabled(), null, "d2");
198
- this.assertIdentical(ch2.getEnabled(), null, "d3");
199
- this.assertIdentical(ch3.getEnabled(), null, "d4");
672
+ pa.setEnabled(true);
673
+ this.assertTrue(pa.getEnabled(), "After setting enabled to true, it should return true");
200
674
 
201
- pa.add(ch1);
675
+ pa.dispose();
676
+
677
+ //old, deprecated behaviour
678
+ qx.core.Environment.set("qx.core.property.Property.inheritableDefaultIsNull", true);
679
+ pa = new qx.test.core.InheritanceDummy();
680
+ this.assertNull(pa.getEnabled(), "Initial value of enabled should be null");
681
+ pa.dispose();
682
+ qx.core.Environment.set("qx.core.property.Property.inheritableDefaultIsNull", false);
683
+ },
684
+
685
+ testRefine() {
686
+ qx.Class.undefine("qx.test.core.property.TestRefineBase");
687
+ qx.Class.define("qx.test.core.property.TestRefineBase", {
688
+ extend: qx.core.Object,
689
+ properties: {
690
+ nullableProp: {
691
+ init: 10,
692
+ check: "Number",
693
+ nullable: true,
694
+ apply: "_applyNullableProp"
695
+ }
696
+ },
697
+ members: {
698
+ applyCount: 0,
699
+ _applyNullableProp(value, old) {
700
+ if (qx.core.Environment.get("qx.core.property.Property.applyDuringConstruct")) {
701
+ if (value === old) {
702
+ throw new Error("superclass: _applyNullableProp called with identical value");
703
+ }
704
+ }
705
+ this.lastApply = [value, old];
706
+ this.applyCount++;
202
707
 
203
- this.assertTrue(pa.setEnabled(true), "a1"); // ch1 gets enabled, too
204
- this.assertFalse(ch3.setEnabled(false), "a2");
708
+ console.log(`superclass apply running: value changing from ${old} to ${value}`);
709
+ }
710
+ }
711
+ });
205
712
 
206
- this.assertTrue(pa.getEnabled(), "b1");
207
- this.assertTrue(ch1.getEnabled(), "b2");
208
- this.assertIdentical(ch2.getEnabled(), null, "b3");
209
- this.assertFalse(ch3.getEnabled(), "b4");
713
+ qx.Class.undefine("qx.test.core.property.TestRefineChild");
714
+ qx.Class.define("qx.test.core.property.TestRefineChild", {
715
+ extend: qx.test.core.property.TestRefineBase,
716
+ properties: {
717
+ nullableProp: {
718
+ refine: true,
719
+ init: 12
720
+ }
721
+ }
722
+ });
210
723
 
211
- pa.add(ch2); // make ch2 enabled_ through inheritance
212
- pa.add(ch3); // keep ch2 disabled, user value has higher priority
724
+ let x = new qx.test.core.property.TestRefineChild();
725
+ this.assertEquals(12, x.getNullableProp(), "refined property should have init value 12");
726
+ this.assertEquals(1, x.applyCount, "apply count should be 1 after construction");
727
+ this.assertArrayEquals([12, undefined], x.lastApply, "apply should be called with correct args");
728
+
729
+ try {
730
+ qx.Class.define(null, {
731
+ extend: qx.test.core.property.TestRefineBase,
732
+ properties: {
733
+ nullableProp: {
734
+ init: 20,
735
+ check: "Integer"
736
+ }
737
+ }
738
+ });
739
+ this.fail("Redefining a property without refine should throw an error");
740
+ } catch (e) {}
741
+
742
+ let trueDef = {
743
+ init: 10,
744
+ check: "Number",
745
+ nullable: true,
746
+ apply: "_applyNullableProp"
747
+ };
213
748
 
214
- this.assertTrue(pa.getEnabled(), "c1");
215
- this.assertTrue(ch1.getEnabled(), "c2");
216
- this.assertTrue(ch2.getEnabled(), "c3");
217
- this.assertFalse(ch3.getEnabled(), "c4");
749
+ this.assertDeepEquals(
750
+ trueDef,
751
+ qx.Class.getPropertyDefinition(qx.test.core.property.TestRefineBase, "nullableProp"),
752
+ "getPropertyDefinition output incorrect"
753
+ );
218
754
 
219
- pa.dispose();
220
- ch1.dispose();
221
- ch2.dispose();
222
- ch3.dispose();
755
+ this.assertDeepEquals(
756
+ trueDef,
757
+ qx.Class.getPropertyDefinition(qx.test.core.property.TestRefineChild, "nullableProp"),
758
+ "getPropertyDefinition must return the original definition"
759
+ );
223
760
  },
224
761
 
225
762
  testMultiValues() {
226
- this.assertNotUndefined(qx.core.Property);
227
-
228
763
  // Check instance
229
764
  var inst = new qx.test.core.PropertyHelper();
230
765
  this.assertNotUndefined(inst, "instance");
@@ -264,31 +799,6 @@ qx.Class.define("qx.test.core.Property", {
264
799
  inst.dispose();
265
800
  },
266
801
 
267
- testInitApply() {
268
- var inst = new qx.test.core.PropertyHelper();
269
- this.assertNotUndefined(inst, "instance");
270
-
271
- this.assertUndefined(inst.lastApply);
272
- inst.setInitApplyProp1("juhu"); //set to init value
273
- this.assertJsonEquals(["juhu", "juhu"], inst.lastApply);
274
- inst.lastApply = undefined;
275
-
276
- inst.setInitApplyProp1("juhu"); // set to same value
277
- this.assertUndefined(inst.lastApply); // apply must not be called
278
- inst.lastApply = undefined;
279
-
280
- inst.setInitApplyProp1("kinners"); // set to new value
281
- this.assertJsonEquals(["kinners", "juhu"], inst.lastApply);
282
- inst.lastApply = undefined;
283
-
284
- this.assertUndefined(inst.lastApply);
285
- inst.setInitApplyProp2(null); //set to init value
286
- this.assertJsonEquals([null, null], inst.lastApply);
287
- inst.lastApply = undefined;
288
-
289
- inst.dispose();
290
- },
291
-
292
802
  testInit() {
293
803
  // now test the init functions
294
804
  var self = this;
@@ -305,11 +815,24 @@ qx.Class.define("qx.test.core.Property", {
305
815
  inst.dispose();
306
816
  },
307
817
 
818
+ testInitFunction() {
819
+ let inst = new qx.test.cpnfv8.Superclass();
820
+ let initial = inst.getJsdocProp();
821
+ let second = inst.getJsdocProp();
822
+ this.assertArrayEquals([10, 20, 30], initial, "properties created with initFunction returned by getter should be the same");
823
+ this.assertIdentical(initial, second, "properties created with initFunction returned by getter should be the same");
824
+ },
825
+
308
826
  testDefinesThanSubClassWithInterface() {
309
827
  // see bug #2162 for details
310
- delete qx.test.A;
311
- delete qx.test.B;
312
- delete qx.test.IForm;
828
+ if (qx.test.A) {
829
+ qx.Class.undefine("qx.test.A");
830
+ delete qx.test.A;
831
+ }
832
+ if (qx.test.B) {
833
+ qx.Class.undefine("qx.test.B");
834
+ delete qx.test.B;
835
+ }
313
836
 
314
837
  qx.Class.define("qx.test.A", {
315
838
  extend: qx.core.Object,
@@ -338,16 +861,19 @@ qx.Class.define("qx.test.core.Property", {
338
861
  b.dispose();
339
862
  },
340
863
 
341
- testPropertyNamedClassname() {
342
- qx.Class.define("qx.test.clName", {
343
- extend: qx.core.Object,
344
- properties: {
345
- classname: {}
346
- }
347
- });
864
+ // BC break for qooxdoo v8: properties, members, and internals are
865
+ // all in the same namespace now. `classname` is an internal member
866
+ // name, so can't be used as a property name.
867
+ // testPropertyNamedClassname() {
868
+ // qx.Class.define("qx.test.clName", {
869
+ // extend: qx.core.Object,
870
+ // properties: {
871
+ // classname: {}
872
+ // }
873
+ // });
348
874
 
349
- delete qx.test.clName;
350
- },
875
+ // delete qx.test.clName;
876
+ // },
351
877
 
352
878
  testWrongPropertyDefinitions() {
353
879
  if (qx.core.Environment.get("qx.debug")) {
@@ -364,7 +890,7 @@ qx.Class.define("qx.test.core.Property", {
364
890
  qx.Class.define("qx.test.clName", config);
365
891
  },
366
892
  Error,
367
- new RegExp(".*Invalid.*"),
893
+ new RegExp("Invalid key.*The value needs to be a map"),
368
894
  "123"
369
895
  );
370
896
 
@@ -381,7 +907,7 @@ qx.Class.define("qx.test.core.Property", {
381
907
  qx.Class.define("qx.test.clName", config);
382
908
  },
383
909
  Error,
384
- new RegExp(".*Invalid.*"),
910
+ new RegExp("Invalid key.*The value needs to be a map"),
385
911
  "123"
386
912
  );
387
913
 
@@ -399,7 +925,7 @@ qx.Class.define("qx.test.core.Property", {
399
925
  qx.Class.define("qx.test.clName", config);
400
926
  },
401
927
  Error,
402
- new RegExp(".*Invalid.*"),
928
+ new RegExp("Can't use qx.core.Object descendent as property map"),
403
929
  "123"
404
930
  );
405
931
 
@@ -417,7 +943,7 @@ qx.Class.define("qx.test.core.Property", {
417
943
  qx.Class.define("qx.test.clName", config);
418
944
  },
419
945
  Error,
420
- new RegExp(".*Invalid.*"),
946
+ new RegExp("Invalid key.*The value needs to be a map"),
421
947
  "123"
422
948
  );
423
949
 
@@ -434,7 +960,7 @@ qx.Class.define("qx.test.core.Property", {
434
960
  qx.Class.define("qx.test.clName", config);
435
961
  },
436
962
  Error,
437
- new RegExp(".*Invalid.*"),
963
+ new RegExp("Invalid key.*The value needs to be a map"),
438
964
  "123"
439
965
  );
440
966
 
@@ -451,7 +977,7 @@ qx.Class.define("qx.test.core.Property", {
451
977
  qx.Class.define("qx.test.clName", config);
452
978
  },
453
979
  Error,
454
- new RegExp(".*Invalid.*"),
980
+ new RegExp("typeof value for key.* must be"),
455
981
  "123"
456
982
  );
457
983
 
@@ -468,7 +994,7 @@ qx.Class.define("qx.test.core.Property", {
468
994
  qx.Class.define("qx.test.clName", config);
469
995
  },
470
996
  Error,
471
- new RegExp(".*Invalid.*"),
997
+ new RegExp("typeof value for key.* must be"),
472
998
  "123"
473
999
  );
474
1000
 
@@ -477,10 +1003,12 @@ qx.Class.define("qx.test.core.Property", {
477
1003
  },
478
1004
 
479
1005
  testRecursive() {
1006
+ qx.Class.undefine("qx.Node");
480
1007
  qx.Class.define("qx.Node", {
481
1008
  extend: qx.core.Object,
482
1009
 
483
1010
  construct() {
1011
+ super();
484
1012
  this._min = 0;
485
1013
  },
486
1014
 
@@ -508,6 +1036,7 @@ qx.Class.define("qx.test.core.Property", {
508
1036
  },
509
1037
 
510
1038
  testEventWithInitOldData() {
1039
+ qx.Class.undefine("qx.TestProperty");
511
1040
  qx.Class.define("qx.TestProperty", {
512
1041
  extend: qx.core.Object,
513
1042
 
@@ -544,6 +1073,7 @@ qx.Class.define("qx.test.core.Property", {
544
1073
  },
545
1074
 
546
1075
  testEventWithoutInitOldData() {
1076
+ qx.Class.undefine("qx.TestProperty");
547
1077
  qx.Class.define("qx.TestProperty", {
548
1078
  extend: qx.core.Object,
549
1079
 
@@ -580,6 +1110,7 @@ qx.Class.define("qx.test.core.Property", {
580
1110
  },
581
1111
 
582
1112
  testEventWithInitAndInheritableOldData() {
1113
+ qx.Class.undefine("qx.TestProperty");
583
1114
  qx.Class.define("qx.TestProperty", {
584
1115
  extend: qx.core.Object,
585
1116
 
@@ -617,6 +1148,7 @@ qx.Class.define("qx.test.core.Property", {
617
1148
  },
618
1149
 
619
1150
  testEventWithoutInitAndInheritableOldData() {
1151
+ qx.Class.undefine("qx.TestProperty");
620
1152
  qx.Class.define("qx.TestProperty", {
621
1153
  extend: qx.core.Object,
622
1154
 
@@ -659,30 +1191,10 @@ qx.Class.define("qx.test.core.Property", {
659
1191
  ---------------------------------------------------------------------------
660
1192
  */
661
1193
 
662
- /**
663
- * Check whether the (numeric) value is negative zero (-0)
664
- *
665
- * @param value {number} Value to check
666
- * @return {Boolean} whether the value is <code>-0</code>
667
- */
668
- __isNegativeZero(value) {
669
- return value === 0 && 1 / value < 0; // 1/-0 => -Infinity
670
- },
671
-
672
- /**
673
- * Check whether the (numeric) value is positive zero (+0)
674
- *
675
- * @param value {number} Value to check
676
- * @return {Boolean} whether the value is <code>+0</code>
677
- */
678
- __isPositiveZero(value) {
679
- return value === 0 && 1 / value > 0; // 1/+0 => +Infinity
680
- },
681
-
682
- testWrongIsEqualDefinitions() {
683
- if (qx.core.Environment.get("qx.debug")) {
684
- var re = new RegExp("Invalid type for 'isEqual'.*");
685
- var o = new qx.core.Object();
1194
+ testWrongIsEqualDefinitions() {
1195
+ if (qx.core.Environment.get("qx.debug")) {
1196
+ var re = new RegExp("defined with wrong value type for key 'isEqual'");
1197
+ var o = new qx.core.Object();
686
1198
 
687
1199
  [
688
1200
  new Date(), // date
@@ -698,6 +1210,7 @@ qx.Class.define("qx.test.core.Property", {
698
1210
  var msg = "case[" + i + "] (" + String(isEqualTestValue) + ")";
699
1211
  this.assertException(
700
1212
  function () {
1213
+ qx.Class.undefine("qx.TestProperty");
701
1214
  qx.Class.define("qx.TestProperty", {
702
1215
  extend: qx.core.Object,
703
1216
  properties: {
@@ -715,7 +1228,7 @@ qx.Class.define("qx.test.core.Property", {
715
1228
  msg
716
1229
  );
717
1230
 
718
- delete qx.TestProperty;
1231
+ qx.Class.undefine("qx.TestProperty");
719
1232
  }, this);
720
1233
 
721
1234
  o.dispose();
@@ -723,6 +1236,7 @@ qx.Class.define("qx.test.core.Property", {
723
1236
  },
724
1237
 
725
1238
  testIsEqualInline() {
1239
+ qx.Class.undefine("qx.TestProperty");
726
1240
  qx.Class.define("qx.TestProperty", {
727
1241
  extend: qx.core.Object,
728
1242
  properties: {
@@ -777,6 +1291,7 @@ qx.Class.define("qx.test.core.Property", {
777
1291
  },
778
1292
 
779
1293
  testIsEqualFunction() {
1294
+ qx.Class.undefine("qx.TestProperty");
780
1295
  qx.Class.define("qx.TestProperty", {
781
1296
  extend: qx.core.Object,
782
1297
  properties: {
@@ -833,6 +1348,7 @@ qx.Class.define("qx.test.core.Property", {
833
1348
  },
834
1349
 
835
1350
  testIsEqualMember() {
1351
+ qx.Class.undefine("qx.TestProperty");
836
1352
  qx.Class.define("qx.TestProperty", {
837
1353
  extend: qx.core.Object,
838
1354
  properties: {
@@ -895,6 +1411,7 @@ qx.Class.define("qx.test.core.Property", {
895
1411
  testIsEqualInlineContext() {
896
1412
  var context, object;
897
1413
 
1414
+ qx.Class.undefine("qx.TestProperty");
898
1415
  qx.Class.define("qx.TestProperty", {
899
1416
  extend: qx.core.Object,
900
1417
  properties: {
@@ -913,7 +1430,8 @@ qx.Class.define("qx.test.core.Property", {
913
1430
  }
914
1431
  });
915
1432
 
916
- object = new qx.TestProperty().set({ prop: 4711 });
1433
+ object = new qx.TestProperty();
1434
+ object.set({ prop: 4711 });
917
1435
 
918
1436
  this.assertIdentical(object, context);
919
1437
 
@@ -923,6 +1441,7 @@ qx.Class.define("qx.test.core.Property", {
923
1441
  testIsEqualFunctionContext() {
924
1442
  var context, object;
925
1443
 
1444
+ qx.Class.undefine("qx.TestProperty");
926
1445
  qx.Class.define("qx.TestProperty", {
927
1446
  extend: qx.core.Object,
928
1447
  properties: {
@@ -947,6 +1466,7 @@ qx.Class.define("qx.test.core.Property", {
947
1466
  testIsEqualMemberContext() {
948
1467
  var context, object;
949
1468
 
1469
+ qx.Class.undefine("qx.TestProperty");
950
1470
  qx.Class.define("qx.TestProperty", {
951
1471
  extend: qx.core.Object,
952
1472
  properties: {
@@ -975,6 +1495,7 @@ qx.Class.define("qx.test.core.Property", {
975
1495
  testIsEqualBaseClassMember() {
976
1496
  var context, object;
977
1497
 
1498
+ qx.Class.undefine("qx.Super");
978
1499
  qx.Class.define("qx.Super", {
979
1500
  extend: qx.core.Object,
980
1501
  members: {
@@ -984,6 +1505,7 @@ qx.Class.define("qx.test.core.Property", {
984
1505
  }
985
1506
  });
986
1507
 
1508
+ qx.Class.undefine("qx.TestProperty");
987
1509
  qx.Class.define("qx.TestProperty", {
988
1510
  extend: qx.Super,
989
1511
  properties: {
@@ -1004,11 +1526,12 @@ qx.Class.define("qx.test.core.Property", {
1004
1526
  },
1005
1527
 
1006
1528
  testTransform() {
1529
+ qx.core.Environment.set("qx.core.property.Property.allowDeferredInit", true);
1530
+ qx.Class.undefine("qx.TestProperty");
1007
1531
  qx.Class.define("qx.TestProperty", {
1008
1532
  extend: qx.core.Object,
1009
1533
  construct() {
1010
1534
  super();
1011
- this.initPropTwo(new qx.data.Array());
1012
1535
  },
1013
1536
  properties: {
1014
1537
  prop: {
@@ -1023,13 +1546,13 @@ qx.Class.define("qx.test.core.Property", {
1023
1546
  nullable: true,
1024
1547
  event: "changePropTwo",
1025
1548
  transform: "__transform",
1026
- deferredInit: true
1549
+ initFunction: () => new qx.data.Array()
1027
1550
  }
1028
1551
  },
1029
1552
 
1030
1553
  members: {
1031
1554
  __transform(value, oldValue) {
1032
- if (oldValue === undefined) {
1555
+ if (oldValue == null) {
1033
1556
  return value;
1034
1557
  }
1035
1558
  if (!value) {
@@ -1060,16 +1583,76 @@ qx.Class.define("qx.test.core.Property", {
1060
1583
  object.setPropTwo(arr2);
1061
1584
  this.assertIdentical(savePropTwo, object.getPropTwo());
1062
1585
  this.assertArrayEquals(["2", "3"], savePropTwo.toArray());
1586
+ qx.core.Environment.set("qx.core.property.Property.allowDeferredInit", false);
1063
1587
  },
1064
1588
 
1065
- testPromises() {
1066
- const promiseDelay = (delay, fn) => new qx.Promise(resolve => {
1067
- setTimeout(async () => {
1068
- await fn();
1069
- resolve();
1070
- }, delay);
1589
+ testDeferredInit() {
1590
+ try {
1591
+ qx.Class.define("qx.TestProperty", {
1592
+ extend: qx.core.Object,
1593
+
1594
+ construct() {
1595
+ super();
1596
+ },
1597
+
1598
+ properties: {
1599
+ prop: {
1600
+ check: "String",
1601
+ deferredInit: true
1602
+ }
1603
+ }
1604
+ });
1605
+ this.fail("Deferred init should not be allowed unless environment setting `qx.core.property.Property.allowDeferredInit` is true");
1606
+ } catch (e) {}
1607
+
1608
+ qx.core.Environment.set("qx.core.property.Property.allowDeferredInit", true);
1609
+ qx.Class.undefine("qx.TestProperty");
1610
+ qx.Class.define("qx.TestProperty", {
1611
+ extend: qx.core.Object,
1612
+
1613
+ construct() {
1614
+ super();
1615
+ this.initProp("hello");
1616
+ this.addListener("changeProp", () => {
1617
+ throw new Error("Deferred init should not trigger change event");
1618
+ });
1619
+ },
1620
+
1621
+ properties: {
1622
+ prop: {
1623
+ check: "String",
1624
+ deferredInit: true,
1625
+ apply: "_applyProp",
1626
+ event: "changeProp"
1627
+ }
1628
+ },
1629
+
1630
+ members: {
1631
+ _applyProp(value, old) {
1632
+ this.applyCalled = true;
1633
+ this.assertEquals("hello", value, "Deferred init should set the value to 'hello'");
1634
+ this.assertUndefined(old, "Deferred init should not have an old value");
1635
+ }
1636
+ }
1071
1637
  });
1072
1638
 
1639
+ var object = new qx.TestProperty();
1640
+ this.assertEquals("hello", object.getProp());
1641
+ this.assertTrue(object.applyCalled);
1642
+ object.dispose();
1643
+ qx.core.Environment.set("qx.core.property.Property.allowDeferredInit", false);
1644
+ },
1645
+
1646
+ testPromises() {
1647
+ const promiseDelay = (delay, fn) =>
1648
+ new qx.Promise(resolve => {
1649
+ setTimeout(async () => {
1650
+ await fn();
1651
+ resolve();
1652
+ }, delay);
1653
+ });
1654
+
1655
+ qx.Class.undefine("qxl.TestPromises");
1073
1656
  qx.Class.define("qxl.TestPromises", {
1074
1657
  extend: qx.core.Object,
1075
1658
 
@@ -1098,8 +1681,8 @@ qx.Class.define("qx.test.core.Property", {
1098
1681
  members: {
1099
1682
  state: null,
1100
1683
 
1101
- async _applyPropOne(value) {
1102
- await promiseDelay(10, () => {
1684
+ _applyPropOne(value) {
1685
+ promiseDelay(10, () => {
1103
1686
  this.state.push("apply-one");
1104
1687
  });
1105
1688
  return "apply-one";
@@ -1134,7 +1717,6 @@ qx.Class.define("qx.test.core.Property", {
1134
1717
  let tmp;
1135
1718
  let tp;
1136
1719
  let result;
1137
- ("");
1138
1720
 
1139
1721
  tp = createTestPromise();
1140
1722
  tmp = tp.setPropOne(12);
@@ -1152,18 +1734,653 @@ qx.Class.define("qx.test.core.Property", {
1152
1734
  this.assertArrayEquals(tp.state, []);
1153
1735
  result = await tmp;
1154
1736
  this.assertTrue(result === 16);
1155
- this.assertArrayEquals(tp.state, ["apply-two", "event-two"]);
1737
+ this.assertArrayEquals(tp.state, ["apply-one", "apply-two", "apply-two", "event-two"]);
1156
1738
 
1157
1739
  tp = createTestPromise();
1158
- tmp = tp.setPropTwoAsync(qx.Promise.resolve(18));
1740
+ tmp = tp.setAsync("propTwo", qx.Promise.resolve(18));
1159
1741
  this.assertTrue(qx.lang.Type.isPromise(tmp));
1160
1742
  this.assertArrayEquals(tp.state, []);
1161
1743
  result = await tmp;
1162
1744
  this.assertTrue(result === 18);
1163
- this.assertArrayEquals(tp.state, ["apply-two", "event-two"]);
1745
+ this.assertArrayEquals(tp.state, ["apply-one", "apply-two", "apply-two", "event-two"]);
1746
+ tmp = await tp.setAsync({ propTwo: qx.Promise.resolve(18) });
1747
+ this.assertIdentical(tp, tmp);
1748
+ this.assertArrayEquals(tp.state, ["apply-one", "apply-two", "apply-two", "event-two", "apply-two", "event-two"]);
1164
1749
  };
1165
- testImpl().then(() => this.resume());
1750
+ testImpl().finally(() => this.resume());
1166
1751
  this.wait(1000);
1752
+ },
1753
+
1754
+ testPseudoProperties() {
1755
+ let classPseudoProperty = qx.Class.define(null, {
1756
+ extend: qx.core.Object,
1757
+
1758
+ events: {
1759
+ changePseudoProp: "qx.event.type.Data"
1760
+ },
1761
+
1762
+ members: {
1763
+ applyCount: 0,
1764
+ __pseudoProp: 23,
1765
+ _applyPseudoProp(value, oldValue) {
1766
+ this.applyCount++;
1767
+ this._lastApply = [value, oldValue];
1768
+ },
1769
+
1770
+ getPseudoProp() {
1771
+ return this.__pseudoProp;
1772
+ },
1773
+
1774
+ setPseudoProp(value) {
1775
+ let oldValue = this.__pseudoProp;
1776
+ this.__pseudoProp = value;
1777
+ this._applyPseudoProp(value, oldValue);
1778
+ this.fireDataEvent("changePseudoProp", value, oldValue);
1779
+ }
1780
+ }
1781
+ });
1782
+
1783
+ let classPseudoPropertyNoEvent = qx.Class.define(null, {
1784
+ extend: qx.core.Object,
1785
+
1786
+ members: {
1787
+ __pseudoProp: 23,
1788
+
1789
+ getPseudoProp() {
1790
+ return this.__pseudoProp;
1791
+ },
1792
+
1793
+ setPseudoProp(value) {
1794
+ this.__pseudoProp = value;
1795
+ }
1796
+ }
1797
+ });
1798
+
1799
+ let classPseudoPropertyNoGetter = qx.Class.define(null, {
1800
+ extend: qx.core.Object,
1801
+
1802
+ events: {
1803
+ changePseudoProp: "qx.event.type.Data"
1804
+ },
1805
+
1806
+ members: {
1807
+ __pseudoProp: 23,
1808
+
1809
+ setPseudoProp(value) {
1810
+ this.__pseudoProp = value;
1811
+ }
1812
+ }
1813
+ });
1814
+
1815
+ let classPseudoPropertyNoSetter = qx.Class.define(null, {
1816
+ extend: qx.core.Object,
1817
+
1818
+ events: {
1819
+ changePseudoProp: "qx.event.type.Data"
1820
+ },
1821
+
1822
+ members: {
1823
+ __pseudoProp: 23,
1824
+
1825
+ getPseudoProp() {
1826
+ return this.__pseudoProp;
1827
+ }
1828
+ }
1829
+ });
1830
+
1831
+ let pp = new classPseudoProperty();
1832
+ let eventCount = 0;
1833
+ pp.addListener("changePseudoProp", () => {
1834
+ eventCount++;
1835
+ });
1836
+ let prop = qx.Class.getByProperty(classPseudoProperty, "pseudoProp");
1837
+ this.assertNotNull(prop, "pseudo prop should be defined as a property object");
1838
+ this.assertNull(prop.getDefinition(), "pseudo prop should have no definition");
1839
+ this.assertEquals(23, pp.pseudoProp);
1840
+ this.assertEquals(0, pp.applyCount, "apply called unexpectedly");
1841
+ this.assertEquals(0, eventCount, "event fired unexpectedly");
1842
+ pp.pseudoProp = 42;
1843
+ this.assertEquals(42, pp.pseudoProp);
1844
+ this.assertEquals(42, pp.getPseudoProp());
1845
+ this.assertEquals(1, pp.applyCount, "apply should only be called once after set using =");
1846
+ this.assertEquals(1, eventCount, "event should only be fired once after set using =");
1847
+ pp.setPseudoProp(77);
1848
+ this.assertEquals(2, pp.applyCount, "apply should only be called once after set using setter");
1849
+ this.assertEquals(2, eventCount, "event should only be fired once after set using setter");
1850
+ this.assertEquals(77, pp.pseudoProp);
1851
+
1852
+ pp = new classPseudoPropertyNoEvent();
1853
+ this.assertUndefined(pp.pseudoProp);
1854
+
1855
+ pp = new classPseudoPropertyNoGetter();
1856
+ this.assertUndefined(pp.pseudoProp);
1857
+
1858
+ pp = new classPseudoPropertyNoSetter();
1859
+ this.assertNotUndefined(pp.pseudoProp);
1860
+ let prop2 = qx.Class.getByProperty(classPseudoPropertyNoSetter, "pseudoProp");
1861
+ this.assertTrue(prop2.isReadOnly(), "pseudoProp with no setter must be read-only");
1862
+ },
1863
+
1864
+ testImmutableArray() {
1865
+ let immutableArray = new qx.test.cpnfv8.ImmutableArray();
1866
+ let a1 = immutableArray.a;
1867
+ console.log(`immutable array a1=`, a1);
1868
+ immutableArray.a = [10, 20];
1869
+ let a2 = immutableArray.a;
1870
+ console.log(`immutable array a2=`, a2);
1871
+ this.assertIdentical(a1, a2, "immutable array remains unchanged after set");
1872
+ },
1873
+
1874
+ testImmutableObject() {
1875
+ let immutableObject = new qx.test.cpnfv8.ImmutableObject();
1876
+ let o1 = immutableObject.a;
1877
+ console.log(`immutable object o1=`, o1);
1878
+ immutableObject.a = { x: 10, y: 20 };
1879
+ let o2 = immutableObject.a;
1880
+ console.log(`immutable object o2=`, o2);
1881
+ this.assertIdentical(o1, o2, "immutable object remains unchanged after set");
1882
+ },
1883
+
1884
+ testMemberVariableAccess() {
1885
+ let superinstance = new qx.test.cpnfv8.Superclass(false);
1886
+ this.assertEquals(23, superinstance.num, "superinstance.num == 23");
1887
+ this.assertEquals("hello world", superinstance.str, "superinstance.str == 'hello world'");
1888
+ },
1889
+
1890
+ testPropertySetGetFunctionalAndFirstClass() {
1891
+ let superinstance = new qx.test.cpnfv8.Superclass(false);
1892
+
1893
+ this.assertFalse(superinstance.getRunning(), "running initial value (functional) === false");
1894
+
1895
+ this.assertFalse(superinstance.running, "running initial value (first class) === false");
1896
+
1897
+ // Test functional property set
1898
+ superinstance.setRunning(true);
1899
+
1900
+ this.assertTrue(superinstance.getRunning(), "running after setter (functional) === true");
1901
+
1902
+ this.assertTrue(superinstance.running, "running after setter (first class) === true");
1903
+
1904
+ superinstance.running = false;
1905
+ this.assertFalse(superinstance.getRunning(), "running after assignment (functional) === false");
1906
+
1907
+ this.assertFalse(superinstance.running, "running after assignment (first class) === false");
1908
+
1909
+ // test check: "Boolean"'s togglePropertyName and isPropertyName functions
1910
+ superinstance.toggleRunning();
1911
+ this.assertTrue(superinstance.running, "running after toggle === true");
1912
+ this.assertTrue(superinstance.isRunning(), "isRunning() after toggle === true");
1913
+ },
1914
+
1915
+ testSubinstance() {
1916
+ let subinstance = new qx.test.cpnfv8.Subclass(23, true);
1917
+
1918
+ this.assertEquals("I am static", qx.test.cpnfv8.Subclass.staticEntry, "staticEntry === 'I am static'");
1919
+
1920
+ this.assertEquals(23, subinstance.num, "sub num === 23");
1921
+ subinstance.num = 24;
1922
+ this.assertEquals(24, subinstance.num, "sub num === 24");
1923
+ this.assertEquals("hello world", subinstance.str, "sub str == 'hello world'");
1924
+
1925
+ this.assertTrue(subinstance.getRunning(), "sub getRunning() === true");
1926
+ subinstance.running = false;
1927
+ this.assertFalse(subinstance.getRunning(), "sub after setting to false, sub getRunning() === false");
1928
+ },
1929
+
1930
+ testExternalStorage() {
1931
+ let subinstance = new qx.test.cpnfv8.Subclass(23, true);
1932
+
1933
+ this.assertEquals(10, qx.test.cpnfv8.ExternalStorage._subclassStorage.externallyStored, "initial value of externallyStored === 10");
1934
+
1935
+ subinstance.externallyStored = 20;
1936
+
1937
+ this.assertEquals(
1938
+ 20,
1939
+ qx.test.cpnfv8.ExternalStorage._subclassStorage.externallyStored,
1940
+ "post-change value of externallyStored === 20"
1941
+ );
1942
+
1943
+ this.assertEquals(20, subinstance.externallyStored, "retrieved value of externallyStored === 20");
1944
+ },
1945
+
1946
+ testNativeClassExtend() {
1947
+ class NativeClass extends qx.test.cpnfv8.Subclass {
1948
+ constructor(num = 13) {
1949
+ super(num, false);
1950
+ qx.core.Assert.assertEquals(num, this.num, `native class super(): num === ${num}`);
1951
+
1952
+ this.num = 42;
1953
+ qx.core.Assert.assertEquals(42, this.num, "native class assignment: num === 42");
1954
+ }
1955
+ }
1956
+
1957
+ let native = new NativeClass(23);
1958
+
1959
+ // if (!qx.Bootstrap._allowedNonStaticKeys.extendNativeClass) {
1960
+ // // As of Version 8.0, extending a native class is not
1961
+ // // operational, and this test is skipped.
1962
+ // this.skip();
1963
+ // }
1964
+
1965
+ // qx.test.cpnfv8.SubNative = qx.Class.define(null, {
1966
+ // extend: NativeClass,
1967
+ // extendNativeClass: true,
1968
+
1969
+ // construct() {
1970
+ // super();
1971
+ // qx.core.Assert.assertEquals(
1972
+ // 42,
1973
+ // this.num,
1974
+ // "Class extended from native class: this.num === 42"
1975
+ // );
1976
+ // }
1977
+ // });
1978
+
1979
+ // let subNativeClass = new qx.test.cpnfv8.SubNative();
1980
+ },
1981
+
1982
+ testSingleton() {
1983
+ try {
1984
+ let singleton = new qx.test.cpnfv8.Singleton();
1985
+
1986
+ // Fail. Shoould not have gotten here. Should have thrown.
1987
+ this.assertTrue(false, "new qx.test.cpnfv8.Singleton() threw as expected");
1988
+ } catch (e) {
1989
+ // This is the success case. `new qx.test.cpnfv8.Singleton()` should have thrown.
1990
+ this.assertTrue(true, "new qx.test.cpnfv8.Singleton() threw as expected");
1991
+ }
1992
+
1993
+ let singleton = qx.test.cpnfv8.Singleton.getInstance();
1994
+ this.assertTrue(true, "qx.test.cpnfv8.Singleton.getInstance() succeeded");
1995
+ },
1996
+
1997
+ testAbstractClass() {
1998
+ try {
1999
+ let abstractClass = new qx.test.cpnfv8.AbstractClass();
2000
+
2001
+ // Fail. Shoould not have gotten here. Should have thrown.
2002
+ this.assertTrue(false, "new qx.test.cpnfv8.Abstract() threw");
2003
+ } catch (e) {
2004
+ // This is the success case. `new qx.test.cpnfv8.Abstract()` should have thrown.
2005
+ this.assertTrue(true, "new qx.test.cpnfv8.Abstract() threw");
2006
+ }
2007
+
2008
+ try {
2009
+ let subclassOfAbstract = new qx.test.cpnfv8.SubclassOfAbstract();
2010
+ this.assertTrue(true, "new qx.test.cpnfv8.SubclassOfAbstract() succeeded");
2011
+
2012
+ // Test environment settings
2013
+ let greeting = subclassOfAbstract.getGreeting();
2014
+ this.assertEquals("hi there", greeting, "greeting from environment === 'hi there'");
2015
+
2016
+ // Ensure events got added
2017
+ this.assertEquals(
2018
+ "{" +
2019
+ '"changeRecentGreeting":"qx.event.type.Data",' +
2020
+ '"myNormalEvent":"qx.event.type.Event",' +
2021
+ '"myDataEvent":"qx.event.type.Data"' +
2022
+ "}",
2023
+ JSON.stringify(subclassOfAbstract.constructor.$$events),
2024
+ "events list is created correctly"
2025
+ );
2026
+ } catch (e) {
2027
+ this.assertTrue(false, "new qx.test.cpnfv8.SubclassOfAbstract() succeeded");
2028
+ }
2029
+ },
2030
+
2031
+ testNullable() {
2032
+ let superinstance = new qx.test.cpnfv8.Superclass(false);
2033
+
2034
+ try {
2035
+ superinstance.nullableProp = null;
2036
+ this.assertTrue(true, "nullable property can be set to null");
2037
+ } catch (e) {
2038
+ this.assertTrue(false, "nullable property can be set to null");
2039
+ }
2040
+
2041
+ try {
2042
+ superinstance.nonNullableProp = null;
2043
+ this.assertTrue(false, "non-nullable property can not be set to null");
2044
+ } catch (e) {
2045
+ this.assertTrue(true, "non-nullable property can not be set to null");
2046
+ }
2047
+ },
2048
+
2049
+ testValidate() {
2050
+ let superinstance = new qx.test.cpnfv8.Superclass(false);
2051
+
2052
+ try {
2053
+ superinstance.positive = 1;
2054
+ this.assertTrue(true, "validated property can be set to legal value");
2055
+ } catch (e) {
2056
+ this.assertTrue(false, "validated property can be set to legal value");
2057
+ }
2058
+
2059
+ superinstance.positive = 2;
2060
+ this.assertEquals(2, superinstance.getPositive(), "property can be set natively");
2061
+ this.assertEquals(2, superinstance.positive, "property can be set natively");
2062
+
2063
+ try {
2064
+ superinstance.setPositive(-1);
2065
+ this.assertTrue(false, "validated property can not be set to illegal value");
2066
+ } catch (e) {
2067
+ this.assertTrue(true, "validated property can not be set to illegal value");
2068
+ }
2069
+ },
2070
+
2071
+ testReadOnly() {
2072
+ let superinstance = new qx.test.cpnfv8.Superclass(false);
2073
+
2074
+ try {
2075
+ superinstance.readOnly = 0;
2076
+ this.assertTrue(false, "readonly property can not be set");
2077
+ } catch (e) {
2078
+ this.assertTrue(true, "readonly property can not be set", true);
2079
+ }
2080
+ },
2081
+
2082
+ testChecks() {
2083
+ let superinstance = new qx.test.cpnfv8.Superclass(false);
2084
+
2085
+ try {
2086
+ superinstance.running = "lalala";
2087
+ this.assertTrue(false, "check 'Boolean' failed as it should");
2088
+ } catch (e) {
2089
+ this.assertTrue(true, "check 'Boolean' failed as it should");
2090
+ }
2091
+
2092
+ try {
2093
+ superinstance.running = true;
2094
+ superinstance.running = false;
2095
+ superinstance.running = "true";
2096
+ superinstance.running = 0;
2097
+ this.assertFalse(superinstance.running, "check 'Boolean' succeeded as it should");
2098
+ superinstance.running = -1;
2099
+ this.assertTrue(superinstance.running, "check 'Boolean' succeeded as it should");
2100
+ superinstance.running = 1;
2101
+ this.assertTrue(superinstance.running, "check 'Boolean' succeeded as it should");
2102
+ this.assertTrue(true, "check 'Boolean' succeeded as it should");
2103
+ } catch (e) {
2104
+ this.assertTrue(false, "check 'Boolean' succeded as it should");
2105
+ }
2106
+
2107
+ superinstance.jsdocProp = [2, 4, 6];
2108
+
2109
+ try {
2110
+ superinstance.mustBe42 = 42;
2111
+ this.assertTrue(true, "check-function succeeded as it should");
2112
+ } catch (e) {
2113
+ this.assertTrue(false, "check-function succeeded as it should");
2114
+ }
2115
+
2116
+ try {
2117
+ superinstance.mustBe42 = 43;
2118
+ this.assertTrue(false, "check-function failed as it should");
2119
+ } catch (e) {
2120
+ this.assertTrue(true, "check-function failed as it should");
2121
+ }
2122
+ },
2123
+
2124
+ testMemberDetectSameClassProperty() {
2125
+ try {
2126
+ let clazz = qx.Class.define(null, {
2127
+ extend: qx.core.Object,
2128
+ members: {
2129
+ x: 23
2130
+ },
2131
+
2132
+ properties: {
2133
+ x: { init: 42 }
2134
+ }
2135
+ });
2136
+
2137
+ // class definition should have have thrown; should not get here
2138
+ throw new Error("Failed to detect same name in member and property");
2139
+ } catch (e) {
2140
+ this.assertEquals(
2141
+ `Error: Overwriting member or property "x" of Class "null" is not allowed. (Members and properties are in the same namespace.)`,
2142
+ e.toString(),
2143
+ "Property and member of same name in same class not detected"
2144
+ );
2145
+ }
2146
+ },
2147
+
2148
+ testMemberDetectSuperclassProperty() {
2149
+ try {
2150
+ let clazzA = qx.Class.define(null, {
2151
+ extend: qx.core.Object,
2152
+ properties: {
2153
+ x: { init: 42 }
2154
+ }
2155
+ });
2156
+
2157
+ let clazzB = qx.Class.define(null, {
2158
+ extend: clazzA,
2159
+ members: {
2160
+ x: 23
2161
+ }
2162
+ });
2163
+
2164
+ // class definition should have have thrown; should not get here
2165
+ throw new Error("Failed to detect same name in member and superclass property");
2166
+ } catch (e) {
2167
+ this.assertEquals(
2168
+ 'Error: null: Overwriting member or property "x" of Class "null" is not allowed! ' +
2169
+ "(Members and properties are in the same namespace.)",
2170
+ e.toString(),
2171
+ "Member of same name as property in superclass not detected"
2172
+ );
2173
+ }
2174
+ },
2175
+
2176
+ testPropertyDetectSuperclassMember() {
2177
+ try {
2178
+ let clazzA = qx.Class.define(null, {
2179
+ extend: qx.core.Object,
2180
+ members: {
2181
+ x: 23
2182
+ }
2183
+ });
2184
+
2185
+ let clazzB = qx.Class.define(null, {
2186
+ extend: clazzA,
2187
+ properties: {
2188
+ x: { init: 42 }
2189
+ }
2190
+ });
2191
+
2192
+ // class definition should have have thrown; should not get here
2193
+ throw new Error("Failed to detect same name in member and superclass property");
2194
+ } catch (e) {
2195
+ this.assertEquals(
2196
+ 'Error: Overwriting member or property "x" of Class "null" is not allowed. ' +
2197
+ "(Members and properties are in the same namespace.)",
2198
+ e.toString(),
2199
+ "Member of same name as property in superclass not detected"
2200
+ );
2201
+ }
2202
+ },
2203
+
2204
+ testMemberOverloadObjectName() {
2205
+ try {
2206
+ let clazzA = qx.Class.define(null, {
2207
+ extend: qx.core.Object,
2208
+ members: {
2209
+ toString() {
2210
+ return "clazzA";
2211
+ }
2212
+ }
2213
+ });
2214
+
2215
+ let instance = new clazzA();
2216
+ this.assertEquals("clazzA", instance.toString());
2217
+ } catch (e) {
2218
+ throw new Error("Failed to allow member overload of Object method");
2219
+ }
2220
+ },
2221
+
2222
+ testPropertyOverloadObjectNameNoRefine() {
2223
+ try {
2224
+ let clazzA = qx.Class.define(null, {
2225
+ extend: qx.core.Object,
2226
+ properties: {
2227
+ toString: { init: () => "clazzA" }
2228
+ }
2229
+ });
2230
+
2231
+ // class definition should have have thrown; should not get here
2232
+ throw new Error("Failed to detect Object method name in properties");
2233
+ } catch (e) {
2234
+ this.assertEquals(
2235
+ 'Error: Overwriting member or property "toString" of Class "null" is not allowed. (Members and properties are in the same namespace.)',
2236
+ e.toString(),
2237
+ "Property of same name as Object method"
2238
+ );
2239
+ }
2240
+ },
2241
+
2242
+ testPropertyOverloadObjectNameWithRefine() {
2243
+ try {
2244
+ let clazzA = qx.Class.define(null, {
2245
+ extend: qx.core.Object,
2246
+ properties: {
2247
+ toString: { refine: true, init: () => "clazzA" }
2248
+ }
2249
+ });
2250
+
2251
+ // class definition should have have thrown; should not get here
2252
+ throw new Error("Failed to detect Object method name in properties");
2253
+ } catch (e) {
2254
+ this.assertEquals(
2255
+ 'Error: Overwriting member or property "toString" of Class "null" is not allowed. ' +
2256
+ "(Members and properties are in the same namespace.)",
2257
+ e.toString(),
2258
+ "Property of same name as Object method"
2259
+ );
2260
+ }
2261
+ },
2262
+
2263
+ testSetAsPromise() {
2264
+ const doit = async () => {
2265
+ let a = new qx.test.cpnfv8.Superclass();
2266
+ let p = Promise.resolve("hello");
2267
+ a.setPromiseProp(p);
2268
+ this.assertEquals(p, a.getPromiseProp(), "setPromiseProp with Promise works");
2269
+ a.setAnyProp(Promise.resolve("hello"));
2270
+ try {
2271
+ a.setNullableProp(Promise.resolve(42));
2272
+ this.assertTrue(false, "Should throw an error when setting a Promise to a number property");
2273
+ } catch (ex) {
2274
+ this.assertTrue(true, "Should throw an error when setting a Promise to a number property");
2275
+ }
2276
+
2277
+ try {
2278
+ await a.setAsyncPropAsync(Promise.resolve(42));
2279
+ this.assertTrue(false, "Should throw an error when setting a Promise to a number property");
2280
+ } catch (ex) {
2281
+ this.assertTrue(true, "Should throw an error when setting a Promise to a number property");
2282
+ }
2283
+ };
2284
+
2285
+ doit().finally(() => {
2286
+ this.resume();
2287
+ });
2288
+ this.wait(1000);
2289
+ },
2290
+
2291
+ testResetAsync() {
2292
+ let apply = 0;
2293
+ qx.Class.undefine("qx.test.cpnfv8.ResetAsyncTest");
2294
+ var Clazz = qx.Class.define("qx.test.cpnfv8.ResetAsyncTest", {
2295
+ extend: qx.core.Object,
2296
+ properties: {
2297
+ foo: {
2298
+ async: true,
2299
+ init: 7,
2300
+ apply: function (value, old) {
2301
+ return new qx.Promise((resolve, reject) => {
2302
+ setTimeout(() => {
2303
+ apply++;
2304
+ resolve(value);
2305
+ }, 100);
2306
+ });
2307
+ }
2308
+ }
2309
+ }
2310
+ });
2311
+
2312
+ const doit = async () => {
2313
+ let instance = new Clazz();
2314
+ await instance.setFooAsync(42);
2315
+ await instance.resetFooAsync();
2316
+ this.assertEquals(7, instance.getFoo(), "resetFooAsync should reset to initial value");
2317
+ this.assertEquals(3, apply, "apply should be called thrice");
2318
+ };
2319
+
2320
+ doit().then(() => {
2321
+ this.resume();
2322
+ });
2323
+ this.wait(1000);
2324
+ },
2325
+
2326
+ /**
2327
+ * Ensures that an error is thrown when trying to get an async property synchronously
2328
+ * when the property is not ready yet, even if it has an init value.
2329
+ */
2330
+ testGetSyncWhenNotReady() {
2331
+ qx.Class.undefine("qx.test.cpnfv8.GetSyncTest");
2332
+ var Clazz = qx.Class.define("qx.test.cpnfv8.GetSyncTest", {
2333
+ extend: qx.core.Object,
2334
+ properties: {
2335
+ foo: {
2336
+ async: true,
2337
+ init: 7
2338
+ }
2339
+ }
2340
+ });
2341
+
2342
+ const doit = async () => {
2343
+ let instance = new Clazz();
2344
+ //The property storage will be set to the init value during construction,
2345
+ //so we must reset it manually.
2346
+ delete instance.$$propertyValues.foo;
2347
+ let prop = qx.Class.getByProperty(Clazz, "foo");
2348
+ this.assertFalse(prop.isInitialized(instance), "Property foo should not be initialized");
2349
+ this.assertUndefined(instance.getSafe("foo"));
2350
+ try {
2351
+ instance.getFoo();
2352
+ this.assertTrue(false, "getFoo should throw an error when the property is not ready");
2353
+ } catch (e) {}
2354
+ let value = await instance.getFooAsync();
2355
+ this.assertEquals(7, value, "getFooAsync should return the initial value");
2356
+ instance.setFoo(42);
2357
+ this.assertEquals(42, instance.getFoo(), "getFoo should return the updated value");
2358
+ };
2359
+
2360
+ doit().then(() => {
2361
+ this.resume();
2362
+ });
2363
+ this.wait(1000);
2364
+ },
2365
+
2366
+ /**
2367
+ * Check whether the (numeric) value is negative zero (-0)
2368
+ *
2369
+ * @param value {number} Value to check
2370
+ * @return {Boolean} whether the value is <code>-0</code>
2371
+ */
2372
+ __isNegativeZero(value) {
2373
+ return value === 0 && 1 / value < 0; // 1/-0 => -Infinity
2374
+ },
2375
+
2376
+ /**
2377
+ * Check whether the (numeric) value is positive zero (+0)
2378
+ *
2379
+ * @param value {number} Value to check
2380
+ * @return {Boolean} whether the value is <code>+0</code>
2381
+ */
2382
+ __isPositiveZero(value) {
2383
+ return value === 0 && 1 / value > 0; // 1/+0 => +Infinity
1167
2384
  }
1168
2385
  }
1169
2386
  });