@qooxdoo/framework 7.9.2 → 8.0.0-beta.2

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