@nstudio/nativescript-compiler 9.2.0-alpha.16 → 9.2.0-alpha.18

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 (186) hide show
  1. package/README.md +3 -0
  2. package/dist/kit/kit-index.js +9 -0
  3. package/dist/kotlin/access.js +14 -15
  4. package/dist/kotlin/arguments.js +2 -2
  5. package/dist/kotlin/assignment.js +22 -13
  6. package/dist/kotlin/builtins.js +67 -0
  7. package/dist/kotlin/calls.js +3 -2
  8. package/dist/kotlin/class-declaration.js +16 -1
  9. package/dist/kotlin/class-methods.js +2 -2
  10. package/dist/kotlin/components.js +2 -7
  11. package/dist/kotlin/core-api.js +3 -22
  12. package/dist/kotlin/declarations.js +86 -9
  13. package/dist/kotlin/expression-statements.js +13 -1
  14. package/dist/kotlin/functions.js +2 -4
  15. package/dist/kotlin/global-calls.js +1 -4
  16. package/dist/kotlin/literals.js +3 -10
  17. package/dist/kotlin/names.js +6 -4
  18. package/dist/kotlin/native/api.js +1 -1
  19. package/dist/kotlin/native/classfiles.js +2 -13
  20. package/dist/kotlin/operators.js +36 -30
  21. package/dist/kotlin/optional-chains.js +3 -10
  22. package/dist/kotlin/overrides.js +5 -17
  23. package/dist/kotlin/placement.js +1 -12
  24. package/dist/kotlin/state-backend.js +6 -2
  25. package/dist/kotlin/statements.js +1 -13
  26. package/dist/kotlin/translator.js +3 -11
  27. package/dist/kotlin/type-tests.js +1 -1
  28. package/dist/kotlin/types.js +6 -23
  29. package/dist/program/core-facts.js +9 -0
  30. package/dist/semantics/classes.js +15 -0
  31. package/dist/semantics/facts.js +38 -2
  32. package/dist/semantics/lang.js +29 -0
  33. package/dist/semantics/lower.js +144 -0
  34. package/dist/semantics/lowering-methods.js +120 -3
  35. package/dist/semantics/marks.js +30 -0
  36. package/dist/semantics/placement.js +9 -3
  37. package/dist/semantics/refusals.js +12 -11
  38. package/dist/semantics/signals.js +11 -0
  39. package/dist/semantics/states/missing.js +7 -0
  40. package/dist/semantics/tdz.js +142 -8
  41. package/dist/semantics/throws.js +1 -1
  42. package/dist/semantics/translator-methods.js +1 -1
  43. package/dist/swift/access.js +13 -17
  44. package/dist/swift/assignment.js +30 -16
  45. package/dist/swift/calls.js +13 -5
  46. package/dist/swift/classes.js +22 -10
  47. package/dist/swift/components.js +3 -7
  48. package/dist/swift/control-flow.js +1 -1
  49. package/dist/swift/conversion.js +5 -2
  50. package/dist/swift/core-api.js +11 -31
  51. package/dist/swift/declarations.js +1 -6
  52. package/dist/swift/expression-statements.js +7 -0
  53. package/dist/swift/expressions.js +6 -2
  54. package/dist/swift/from-any.js +1 -1
  55. package/dist/swift/functions.js +5 -6
  56. package/dist/swift/global-calls.js +1 -5
  57. package/dist/swift/lenient.js +0 -7
  58. package/dist/swift/literals.js +8 -3
  59. package/dist/swift/method-values.js +1 -19
  60. package/dist/swift/modules.js +5 -3
  61. package/dist/swift/names.js +3 -12
  62. package/dist/swift/native/api.js +3 -1
  63. package/dist/swift/native/calls.js +1 -1
  64. package/dist/swift/native/dispatch.js +2 -8
  65. package/dist/swift/object-classes.js +84 -1
  66. package/dist/swift/operators.js +37 -34
  67. package/dist/swift/optional-chains.js +1 -8
  68. package/dist/swift/parameters.js +0 -4
  69. package/dist/swift/placement.js +5 -15
  70. package/dist/swift/results.js +0 -4
  71. package/dist/swift/state-backend.js +3 -2
  72. package/dist/swift/statements.js +1 -13
  73. package/dist/swift/static-calls.js +2 -3
  74. package/dist/swift/syntax.js +9 -5
  75. package/dist/swift/translator.js +1 -11
  76. package/dist/swift/type-facts.js +3 -3
  77. package/dist/swift/types.js +3 -3
  78. package/dist/targets/ios/build.js +1 -1
  79. package/dist/types/adapter-api.d.ts +3 -3
  80. package/kit-android/generated/kotlin/org/nativescript/kit/__Modules.kt +1 -0
  81. package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +525 -99
  82. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_common.kt +2 -2
  83. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_common.kt +29 -6
  84. package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers_common.kt +14 -0
  85. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_utils.kt +3 -3
  86. package/kit-android/generated/kotlin/org/nativescript/kit/css_mediaquery_index.kt +49 -1
  87. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_array_index.kt +0 -8
  88. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_index.kt +0 -16
  89. package/kit-android/generated/kotlin/org/nativescript/kit/data_virtual_array_index.kt +6 -4
  90. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_index.kt +19 -7
  91. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_http_request_internal_common.kt +14 -0
  92. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_index.kt +19 -10
  93. package/kit-android/generated/kotlin/org/nativescript/kit/matrix_index.kt +17 -29
  94. package/kit-android/generated/kotlin/org/nativescript/kit/media_query_list_index.kt +144 -22
  95. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_parse.kt +8 -3
  96. package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptLifecycleCallbacks.kt +2 -10
  97. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_index.kt +0 -2
  98. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_expression_parser.kt +6 -10
  99. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_index.kt +531 -8
  100. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +0 -9
  101. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_weak_event_listener_index.kt +3 -3
  102. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_index.kt +19 -0
  103. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_properties.kt +5 -2
  104. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_scope.kt +232 -174
  105. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_text_view_common.kt +1 -1
  106. package/kit-android/generated/kotlin/org/nativescript/kit/utils_android_runtime_version.kt +75 -0
  107. package/kit-android/generated/manifest.json +21 -18
  108. package/kit-android/generated/source-lines.json +1 -1
  109. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Array.kt +547 -51
  110. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Intl.kt +1 -1
  111. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/JSON.kt +52 -6
  112. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Language.kt +33 -0
  113. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Prototypes.kt +9 -1
  114. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Strings.kt +32 -18
  115. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Values.kt +137 -28
  116. package/kit-apple/Overlays/xml-free/Core/ui.builder.index.swift +1 -1
  117. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +14 -10
  118. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +3 -9
  119. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +20 -21
  120. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +5 -7
  121. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android_.swift +130 -0
  122. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +2 -4
  123. package/kit-apple/Sources/NativeScriptKit/Core/Object_specified_substituted_reads.swift +115 -0
  124. package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads.swift +113 -0
  125. package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads_.swift +113 -0
  126. package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +348 -330
  127. package/kit-apple/Sources/NativeScriptKit/Core/application.application.ios.swift +358 -359
  128. package/kit-apple/Sources/NativeScriptKit/Core/application.helpers-common.swift +47 -29
  129. package/kit-apple/Sources/NativeScriptKit/Core/connectivity.index.ios.swift +3 -1
  130. package/kit-apple/Sources/NativeScriptKit/Core/css-mediaquery.index.swift +95 -53
  131. package/kit-apple/Sources/NativeScriptKit/Core/css.CSS3Parser.swift +1 -1
  132. package/kit-apple/Sources/NativeScriptKit/Core/css.parser.swift +1 -1
  133. package/kit-apple/Sources/NativeScriptKit/Core/data.observable-array.index.swift +2 -2
  134. package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +52 -43
  135. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.http-request-internal-common.swift +18 -0
  136. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +66 -51
  137. package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +67 -51
  138. package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +24 -6
  139. package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +143 -32
  140. package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +30 -19
  141. package/kit-apple/Sources/NativeScriptKit/Core/media-query-list.index.swift +190 -78
  142. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window.ios.swift +1 -1
  143. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.parse.swift +205 -201
  144. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.stringify.swift +41 -42
  145. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.types.swift +1 -1
  146. package/kit-apple/Sources/NativeScriptKit/Core/trace.index.swift +2 -2
  147. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.index.ios.swift +77 -65
  148. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +4 -4
  149. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +1272 -824
  150. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.index.swift +2 -2
  151. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +8 -8
  152. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -1
  153. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-common.swift +2 -1
  154. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +6 -6
  155. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +22 -21
  156. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +202 -188
  157. package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +2 -6
  158. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +3 -3
  159. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +2 -2
  160. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.clip-path-function.swift +1 -1
  161. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-animation-parser.swift +1 -1
  162. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-selector.swift +2 -2
  163. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-common.swift +2 -2
  164. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-scope.swift +869 -838
  165. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style.index.swift +46 -31
  166. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +1 -2
  167. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +1 -1
  168. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.index.ios.swift +2 -2
  169. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.modal-transition.ios.swift +4 -4
  170. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.page-transition.ios.swift +2 -2
  171. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition-helper.ios.swift +17 -17
  172. package/kit-apple/Sources/NativeScriptKit/Core/utils.android-runtime-version.swift +77 -0
  173. package/kit-apple/Sources/NativeScriptKit/Core/utils.debug-source.swift +2 -2
  174. package/kit-apple/Sources/NativeScriptKit/Core/xhr.index.swift +62 -61
  175. package/kit-apple/Sources/NativeScriptKit/Runtime/Array.swift +4 -0
  176. package/kit-apple/Sources/NativeScriptKit/Runtime/Dynamic.swift +2 -0
  177. package/kit-apple/Sources/NativeScriptKit/Runtime/Interop.swift +1 -1
  178. package/kit-apple/Sources/NativeScriptKit/Runtime/Intl.swift +1 -1
  179. package/kit-apple/Sources/NativeScriptKit/Runtime/Iterators.swift +1 -1
  180. package/kit-apple/Sources/NativeScriptKit/Runtime/JSON.swift +413 -73
  181. package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +3 -2
  182. package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +14 -1
  183. package/kit-apple/Sources/NativeScriptKit/Runtime/Symbol.swift +1 -0
  184. package/kit-apple/Sources/NativeScriptKit/Runtime/Values.swift +1 -0
  185. package/kit-apple/Sources/NativeScriptKit/Runtime/Views.swift +2 -0
  186. package/package.json +2 -2
@@ -467,9 +467,7 @@ public func __init_Core_ui_repeater_index() {
467
467
  if oldValue is ObservableArray {
468
468
  #sourceLocation(file:"@nativescript/core/ui.repeater.index.ts",line:258)
469
469
  try Core_ui_core_weak_event_listener_index.removeWeakEventListener(
470
- { (__o: Any?) -> ObservableArray in
471
- (jsFlat(__o) as? ObservableArray) ?? ObservableArray(jsObject: __o)
472
- }(oldValue), ObservableArray.changeEvent,
470
+ (oldValue as? ObservableArray), ObservableArray.changeEvent,
473
471
  FunctionCell_EventDataOpt_to_Void.adapting(
474
472
  jsMethodValue(jsUnwrap(target, "_onItemsChanged"), "_onItemsChanged") {
475
473
  __r, __i in
@@ -485,9 +483,7 @@ public func __init_Core_ui_repeater_index() {
485
483
  if newValue is ObservableArray {
486
484
  #sourceLocation(file:"@nativescript/core/ui.repeater.index.ts",line:262)
487
485
  try Core_ui_core_weak_event_listener_index.addWeakEventListener(
488
- { (__o: Any?) -> ObservableArray in
489
- (jsFlat(__o) as? ObservableArray) ?? ObservableArray(jsObject: __o)
490
- }(newValue), ObservableArray.changeEvent,
486
+ (newValue as? ObservableArray), ObservableArray.changeEvent,
491
487
  FunctionCell_EventDataOpt_to_Void.adapting(
492
488
  jsMethodValue(jsUnwrap(target, "_onItemsChanged"), "_onItemsChanged") {
493
489
  __r, __i in
@@ -871,7 +871,7 @@ open class SplitView: SplitViewBase {
871
871
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:399)
872
872
  if !jsTruthy(targetVC) {
873
873
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:401)
874
- let frameChild: Any? = try jsUnwrap(self._children, "get").get("secondary")
874
+ let frameChild: Any? = try (jsUnwrap(self._children, "get").get("secondary") as Any?)
875
875
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:402)
876
876
  if try
877
877
  ((jsTruthy(frameChild) && jsTruthy(jsGet(frameChild, "on")))
@@ -935,7 +935,7 @@ open class SplitView: SplitViewBase {
935
935
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:433)
936
936
  if !jsTruthy(targetVC) {
937
937
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:435)
938
- let frameChild: Any? = try jsUnwrap(self._children, "get").get("primary")
938
+ let frameChild: Any? = try (jsUnwrap(self._children, "get").get("primary") as Any?)
939
939
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:436)
940
940
  if try
941
941
  ((jsTruthy(frameChild) && jsTruthy(jsGet(frameChild, "on")))
@@ -1016,7 +1016,7 @@ open class SplitView: SplitViewBase {
1016
1016
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:474)
1017
1017
  if !jsTruthy(targetVC) {
1018
1018
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:476)
1019
- let frameChild: Any? = try jsUnwrap(self._children, "get").get("inspector")
1019
+ let frameChild: Any? = try (jsUnwrap(self._children, "get").get("inspector") as Any?)
1020
1020
  #sourceLocation(file:"@nativescript/core/ui.split-view.index.ios.ts",line:477)
1021
1021
  if try
1022
1022
  ((jsTruthy(frameChild) && jsTruthy(jsGet(frameChild, "on")))
@@ -794,9 +794,9 @@ public enum Core_ui_styling_background {
794
794
  #sourceLocation(file:"@nativescript/core/ui.styling.background.ios.ts",line:535)
795
795
  if try jsUnwrap(values, "length").length == 2 {
796
796
  #sourceLocation(file:"@nativescript/core/ui.styling.background.ios.ts",line:536)
797
- let vx: Any? = try (jsUnwrap(values, "0").element(0) ?? nil)
797
+ let vx: Any? = try ((jsUnwrap(values, "0").element(0) ?? nil) as Any?)
798
798
  #sourceLocation(file:"@nativescript/core/ui.styling.background.ios.ts",line:537)
799
- let vy: Any? = try (jsUnwrap(values, "1").element(1) ?? nil)
799
+ let vy: Any? = try ((jsUnwrap(values, "1").element(1) ?? nil) as Any?)
800
800
  #sourceLocation(file:"@nativescript/core/ui.styling.background.ios.ts",line:538)
801
801
  if try jsStrictEquals(jsGet(vx, "unit"), "%") && jsStrictEquals(jsGet(vy, "unit"), "%") {
802
802
  #sourceLocation(file:"@nativescript/core/ui.styling.background.ios.ts",line:539)
@@ -15,7 +15,7 @@ import SystemConfiguration
15
15
  import UIKit
16
16
  import WebKit
17
17
 
18
- public protocol IClipPathFunction: JSDynamic {
18
+ @MainActor public protocol IClipPathFunction: JSDynamic {
19
19
  var shape: String { get }
20
20
  var rule: String { get }
21
21
  }
@@ -111,7 +111,7 @@ open class CssAnimationParser: JSDynamic, JSExpando, JSStaticKeyed {
111
111
  return __literal1
112
112
  }()
113
113
  #sourceLocation(file:"@nativescript/core/ui.styling.css-animation-parser.ts",line:67)
114
- try jsUnwrap(current, setting: "duration").duration = jsLenientNumber(time)
114
+ try jsUnwrap(current, setting: "duration").duration = try jsConvertedNumber(time)
115
115
  #sourceLocation(file:"@nativescript/core/ui.styling.css-animation-parser.ts",line:68)
116
116
  try jsUnwrap(current, setting: "declarations").declarations = JSArray<KeyframeDeclaration>()
117
117
  #sourceLocation(file:"@nativescript/core/ui.styling.css-animation-parser.ts",line:69)
@@ -15,7 +15,7 @@ import SystemConfiguration
15
15
  import UIKit
16
16
  import WebKit
17
17
 
18
- public protocol ChangeAccumulator: JSDynamic {
18
+ @MainActor public protocol ChangeAccumulator: JSDynamic {
19
19
  func addAttribute(_ node: Any?, _ attribute: String) throws
20
20
  func addPseudoClass(_ node: Any?, _ pseudoClass: String) throws
21
21
  }
@@ -3288,7 +3288,7 @@ open class SelectorsMatch: ChangeAccumulator, JSExpando, JSKeysMade, JSStaticKey
3288
3288
  #sourceLocation(file:"@nativescript/core/ui.styling.css-selector.ts",line:1471)
3289
3289
  _ = try jsCallMethod(
3290
3290
  changeMap, "set", node,
3291
- ({ () -> JSObject in
3291
+ ({ () -> JSObject? in
3292
3292
  set = JSObject([])
3293
3293
  return (set as? JSObject)
3294
3294
  }()))
@@ -369,10 +369,10 @@ public enum Core_ui_styling_font_common {
369
369
  try jsSet(result, "fontVariant", (part as Any?))
370
370
  } else if Core_ui_styling_font_common.styles.has((part ?? "undefined")) {
371
371
  #sourceLocation(file:"@nativescript/core/ui.styling.font-common.ts",line:185)
372
- try jsSet(result, "fontStyle", (part ?? "undefined"))
372
+ try jsSet(result, "fontStyle", (part as Any?))
373
373
  } else if Core_ui_styling_font_common.weights.has((part ?? "undefined")) {
374
374
  #sourceLocation(file:"@nativescript/core/ui.styling.font-common.ts",line:187)
375
- try jsSet(result, "fontWeight", (part ?? "undefined"))
375
+ try jsSet(result, "fontWeight", (part as Any?))
376
376
  } else if try !(jsTruthy(jsGet(result, "fontSize"))) {
377
377
  #sourceLocation(file:"@nativescript/core/ui.styling.font-common.ts",line:189)
378
378
  let sizes: JSArray<String>? = jsSplit((part ?? "undefined"), "/", nil)