@nstudio/nativescript-compiler 9.2.0-alpha.17 → 9.2.0-alpha.19

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 (207) hide show
  1. package/README.md +3 -0
  2. package/config.js +1 -0
  3. package/dist/kotlin/access.js +8 -7
  4. package/dist/kotlin/arguments.js +6 -0
  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 +4 -9
  9. package/dist/kotlin/class-methods.js +2 -2
  10. package/dist/kotlin/core-api.js +1 -1
  11. package/dist/kotlin/declarations.js +1 -1
  12. package/dist/kotlin/expression-statements.js +13 -1
  13. package/dist/kotlin/functions.js +1 -0
  14. package/dist/kotlin/literals.js +4 -8
  15. package/dist/kotlin/names.js +4 -4
  16. package/dist/kotlin/native/api.js +1 -1
  17. package/dist/kotlin/operators.js +25 -25
  18. package/dist/kotlin/optional-chains.js +1 -1
  19. package/dist/kotlin/overrides.js +3 -3
  20. package/dist/kotlin/state-backend.js +6 -2
  21. package/dist/kotlin/translator.js +1 -1
  22. package/dist/kotlin/types.js +4 -4
  23. package/dist/semantics/classes.js +15 -0
  24. package/dist/semantics/conversion.js +9 -1
  25. package/dist/semantics/facts.js +1 -1
  26. package/dist/semantics/lang.js +10 -0
  27. package/dist/semantics/lower.js +54 -0
  28. package/dist/semantics/lowering-methods.js +5 -0
  29. package/dist/semantics/placement.js +9 -3
  30. package/dist/semantics/runtime.js +1 -0
  31. package/dist/semantics/signals.js +11 -0
  32. package/dist/semantics/states/missing.js +7 -0
  33. package/dist/semantics/tdz.js +54 -15
  34. package/dist/semantics/throws.js +2 -2
  35. package/dist/semantics/translator-methods.js +1 -1
  36. package/dist/swift/access.js +7 -9
  37. package/dist/swift/arguments.js +14 -9
  38. package/dist/swift/assignment.js +26 -15
  39. package/dist/swift/calls.js +13 -5
  40. package/dist/swift/class-methods.js +2 -1
  41. package/dist/swift/classes.js +7 -9
  42. package/dist/swift/components.js +3 -3
  43. package/dist/swift/control-flow.js +1 -1
  44. package/dist/swift/conversion.js +5 -2
  45. package/dist/swift/core-api.js +2 -2
  46. package/dist/swift/declarations.js +1 -1
  47. package/dist/swift/expressions.js +6 -2
  48. package/dist/swift/from-any.js +1 -1
  49. package/dist/swift/functions.js +5 -6
  50. package/dist/swift/global-calls.js +1 -1
  51. package/dist/swift/lenient.js +1 -6
  52. package/dist/swift/library.js +2 -2
  53. package/dist/swift/literals.js +8 -3
  54. package/dist/swift/method-values.js +2 -1
  55. package/dist/swift/modules.js +3 -3
  56. package/dist/swift/names.js +7 -7
  57. package/dist/swift/native/calls.js +10 -4
  58. package/dist/swift/object-classes.js +84 -1
  59. package/dist/swift/operators.js +31 -29
  60. package/dist/swift/placement.js +22 -6
  61. package/dist/swift/state-backend.js +3 -2
  62. package/dist/swift/static-calls.js +3 -4
  63. package/dist/swift/syntax.js +10 -6
  64. package/dist/swift/translator.js +1 -1
  65. package/dist/swift/type-facts.js +3 -3
  66. package/dist/swift/types.js +5 -5
  67. package/dist/targets/ios/build.js +1 -1
  68. package/kit-android/generated/kotlin/org/nativescript/kit/__Modules.kt +1 -0
  69. package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +525 -99
  70. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_common.kt +2 -2
  71. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_common.kt +29 -6
  72. package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers_common.kt +14 -0
  73. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_utils.kt +3 -3
  74. package/kit-android/generated/kotlin/org/nativescript/kit/css_mediaquery_index.kt +49 -1
  75. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_array_index.kt +0 -8
  76. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_index.kt +0 -16
  77. package/kit-android/generated/kotlin/org/nativescript/kit/data_virtual_array_index.kt +6 -4
  78. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_index.kt +19 -7
  79. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_http_request_internal_common.kt +14 -0
  80. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_index.kt +19 -10
  81. package/kit-android/generated/kotlin/org/nativescript/kit/matrix_index.kt +17 -29
  82. package/kit-android/generated/kotlin/org/nativescript/kit/media_query_list_index.kt +144 -22
  83. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_parse.kt +8 -3
  84. package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptLifecycleCallbacks.kt +2 -10
  85. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_index.kt +0 -2
  86. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_expression_parser.kt +6 -10
  87. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_index.kt +531 -8
  88. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +0 -9
  89. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_weak_event_listener_index.kt +3 -3
  90. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_index.kt +19 -0
  91. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_properties.kt +5 -2
  92. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_scope.kt +232 -174
  93. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_text_view_common.kt +1 -1
  94. package/kit-android/generated/kotlin/org/nativescript/kit/utils_android_runtime_version.kt +75 -0
  95. package/kit-android/generated/manifest.json +21 -18
  96. package/kit-android/generated/source-lines.json +1 -1
  97. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/NativeScriptApplication.kt +9 -0
  98. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Array.kt +497 -42
  99. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Intl.kt +1 -1
  100. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/JSON.kt +22 -2
  101. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Strings.kt +32 -18
  102. package/kit-apple/Overlays/xml-free/Core/ui.builder.index.swift +7 -3
  103. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +14 -10
  104. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +3 -9
  105. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +20 -21
  106. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +5 -7
  107. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android_.swift +130 -0
  108. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +2 -4
  109. package/kit-apple/Sources/NativeScriptKit/Core/Object_specified_substituted_reads.swift +115 -0
  110. package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads.swift +113 -0
  111. package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads_.swift +113 -0
  112. package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +348 -330
  113. package/kit-apple/Sources/NativeScriptKit/Core/application.application.ios.swift +358 -359
  114. package/kit-apple/Sources/NativeScriptKit/Core/application.helpers-common.swift +47 -29
  115. package/kit-apple/Sources/NativeScriptKit/Core/connectivity.index.ios.swift +3 -1
  116. package/kit-apple/Sources/NativeScriptKit/Core/css-mediaquery.index.swift +95 -53
  117. package/kit-apple/Sources/NativeScriptKit/Core/css.CSS3Parser.swift +1 -1
  118. package/kit-apple/Sources/NativeScriptKit/Core/css.parser.swift +1 -1
  119. package/kit-apple/Sources/NativeScriptKit/Core/data.observable-array.index.swift +3 -3
  120. package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +58 -49
  121. package/kit-apple/Sources/NativeScriptKit/Core/file-system.index.swift +10 -10
  122. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.http-request-internal-common.swift +18 -0
  123. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +67 -52
  124. package/kit-apple/Sources/NativeScriptKit/Core/http.index.swift +3 -3
  125. package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +69 -53
  126. package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +4 -22
  127. package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +144 -32
  128. package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +30 -19
  129. package/kit-apple/Sources/NativeScriptKit/Core/media-query-list.index.swift +190 -78
  130. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window.ios.swift +1 -1
  131. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.parse.swift +205 -201
  132. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.stringify.swift +41 -42
  133. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.types.swift +1 -1
  134. package/kit-apple/Sources/NativeScriptKit/Core/trace.index.swift +2 -2
  135. package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.index.ios.swift +33 -21
  136. package/kit-apple/Sources/NativeScriptKit/Core/ui.activity-indicator.index.ios.swift +12 -6
  137. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.index.ios.swift +77 -65
  138. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.keyframe-animation.swift +1 -1
  139. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +10 -6
  140. package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +14 -13
  141. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +1273 -824
  142. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.index.swift +2 -2
  143. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +87 -67
  144. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -1
  145. package/kit-apple/Sources/NativeScriptKit/Core/ui.date-picker.index.ios.swift +17 -16
  146. package/kit-apple/Sources/NativeScriptKit/Core/ui.dialogs.index.ios.swift +2 -2
  147. package/kit-apple/Sources/NativeScriptKit/Core/ui.editable-text-base.index.ios.swift +27 -18
  148. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-common.swift +2 -1
  149. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +6 -6
  150. package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.index.ios.swift +9 -9
  151. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +6 -6
  152. package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +8 -8
  153. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +22 -21
  154. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.layout-base.ios.swift +4 -3
  155. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass-container.index.ios.swift +1 -1
  156. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass.index.ios.swift +1 -1
  157. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.index.ios.swift +2 -2
  158. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.root-layout-common.swift +9 -9
  159. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-picker.index.ios.swift +9 -6
  160. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +38 -20
  161. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +204 -190
  162. package/kit-apple/Sources/NativeScriptKit/Core/ui.progress.index.ios.swift +12 -10
  163. package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +2 -6
  164. package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +18 -9
  165. package/kit-apple/Sources/NativeScriptKit/Core/ui.search-bar.index.ios.swift +28 -18
  166. package/kit-apple/Sources/NativeScriptKit/Core/ui.segmented-bar.index.ios.swift +19 -12
  167. package/kit-apple/Sources/NativeScriptKit/Core/ui.slider.index.ios.swift +14 -12
  168. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +17 -12
  169. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +2 -2
  170. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.clip-path-function.swift +1 -1
  171. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-animation-parser.swift +1 -1
  172. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-selector.swift +2 -2
  173. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-common.swift +2 -2
  174. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-scope.swift +869 -838
  175. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style.index.swift +46 -31
  176. package/kit-apple/Sources/NativeScriptKit/Core/ui.switch.index.ios.swift +12 -10
  177. package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +36 -20
  178. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +3 -4
  179. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.index.ios.swift +25 -22
  180. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.text-base-common.swift +2 -3
  181. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-field.index.ios.swift +21 -14
  182. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.index.ios.swift +33 -21
  183. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +1 -1
  184. package/kit-apple/Sources/NativeScriptKit/Core/ui.time-picker.index.ios.swift +22 -18
  185. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.index.ios.swift +2 -2
  186. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.modal-transition.ios.swift +4 -4
  187. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.page-transition.ios.swift +2 -2
  188. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition-helper.ios.swift +32 -32
  189. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.index.ios.swift +1 -1
  190. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.web-view-common.swift +2 -2
  191. package/kit-apple/Sources/NativeScriptKit/Core/utils.android-runtime-version.swift +77 -0
  192. package/kit-apple/Sources/NativeScriptKit/Core/utils.debug-source.swift +2 -2
  193. package/kit-apple/Sources/NativeScriptKit/Core/utils.index.ios.swift +2 -2
  194. package/kit-apple/Sources/NativeScriptKit/Core/xhr.index.swift +62 -61
  195. package/kit-apple/Sources/NativeScriptKit/Runtime/Array.swift +4 -0
  196. package/kit-apple/Sources/NativeScriptKit/Runtime/Dynamic.swift +2 -0
  197. package/kit-apple/Sources/NativeScriptKit/Runtime/Interop.swift +1 -1
  198. package/kit-apple/Sources/NativeScriptKit/Runtime/Intl.swift +1 -1
  199. package/kit-apple/Sources/NativeScriptKit/Runtime/Iterators.swift +1 -1
  200. package/kit-apple/Sources/NativeScriptKit/Runtime/JSON.swift +280 -9
  201. package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +3 -2
  202. package/kit-apple/Sources/NativeScriptKit/Runtime/Native.swift +2 -1
  203. package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +1 -0
  204. package/kit-apple/Sources/NativeScriptKit/Runtime/Symbol.swift +1 -0
  205. package/kit-apple/Sources/NativeScriptKit/Runtime/Values.swift +1 -0
  206. package/kit-apple/Sources/NativeScriptKit/Runtime/Views.swift +2 -0
  207. package/package.json +6 -4
@@ -26,9 +26,9 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
26
26
  open var jsExpando: JSObject?
27
27
  open var jsSymbolKeys: [String] { jsExpando?.jsSymbolKeys ?? [] }
28
28
  open func jsDeleteOwn(_ key: String) -> Bool { jsExpando?.delete(key) ?? true }
29
- open class func animate(_ state: Any?, _ transitionContext: any UIViewControllerContextTransitioning?, _ type: Any?)
30
- throws
31
- {
29
+ open class func animate(
30
+ _ state: Any?, _ transitionContext: (any UIViewControllerContextTransitioning)?, _ type: Any?
31
+ ) throws {
32
32
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:123)
33
33
  let transition: Transition? = try jsShaped(jsGet(state, "instance")) { NativeScriptKit.Transition() }
34
34
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:124)
@@ -44,8 +44,8 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
44
44
  } else if __switch1 == SharedTransitionAnimationType.dismiss {
45
45
  __start1 = 1
46
46
  }
47
- let __clause2_end: () -> Void = { __async1.returnValue(()) }
48
- let __clause2: () -> Void = { () -> Void in
47
+ let __clause2_end: @MainActor () -> Void = { __async1.returnValue(()) }
48
+ let __clause2: @MainActor () -> Void = { () -> Void in
49
49
  do {
50
50
  if __start1 > 1 {
51
51
  __clause2_end()
@@ -201,7 +201,7 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
201
201
  })))
202
202
  }
203
203
  #sourceLocation()
204
- let __next1: () -> Void = { () -> Void in
204
+ let __next1: @MainActor () -> Void = { () -> Void in
205
205
  do {
206
206
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:636)
207
207
  do {
@@ -661,19 +661,19 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
661
661
  __async1.returnValue(())
662
662
  return
663
663
  } catch {
664
- { __async1.throwValue($0) }(jsCaught(error))
664
+ __async1.throwValue(jsCaught(error))
665
665
  }
666
666
  }
667
667
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:628)
668
668
  let __it10 = try jsIteratorOf(snapshotData)
669
- let __break1: () -> Void = { () -> Void in
669
+ let __break1: @MainActor () -> Void = { () -> Void in
670
670
  __next1()
671
671
  }
672
672
  let __closeError1: (Any?) -> Void = { (__e_1: Any?) -> Void in
673
673
  __it10.jsClose()
674
- { __async1.throwValue($0) }(__e_1)
674
+ __async1.throwValue(__e_1)
675
675
  }
676
- JSAsyncLoop().run { (__continue1: @escaping () -> Void) -> Void in
676
+ JSAsyncLoop().run { (__continue1: @escaping @MainActor () -> Void) -> Void in
677
677
  do {
678
678
  guard try __it10.jsAdvance() else {
679
679
  __break1()
@@ -709,16 +709,16 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
709
709
  __closeError1(jsCaught(error))
710
710
  }
711
711
  } catch {
712
- { __async1.throwValue($0) }(jsCaught(error))
712
+ __async1.throwValue(jsCaught(error))
713
713
  }
714
714
  }
715
715
  }
716
716
  } catch {
717
- { __async1.throwValue($0) }(jsCaught(error))
717
+ __async1.throwValue(jsCaught(error))
718
718
  }
719
719
  }
720
720
  #sourceLocation()
721
- let __clause1: () -> Void = { () -> Void in
721
+ let __clause1: @MainActor () -> Void = { () -> Void in
722
722
  do {
723
723
  if __start1 > 0 {
724
724
  __clause2()
@@ -829,10 +829,10 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
829
829
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:176)
830
830
  var __it11 = try jsIterated(sharedElements, "sharedElements is not iterable")
831
831
  .makeIterator()
832
- let __break2: () -> Void = { () -> Void in
832
+ let __break2: @MainActor () -> Void = { () -> Void in
833
833
  __async2.returnValue(())
834
834
  }
835
- JSAsyncLoop().run { (__continue2: @escaping () -> Void) -> Void in
835
+ JSAsyncLoop().run { (__continue2: @escaping @MainActor () -> Void) -> Void in
836
836
  do {
837
837
  guard let __item2 = __it11.next() else {
838
838
  __break2()
@@ -877,7 +877,7 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
877
877
  .sharedTransitionTag]
878
878
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:196)
879
879
  let snapshot: UIImageView = UIImageView()
880
- let __next2: () -> Void = { () -> Void in
880
+ let __next2: @MainActor () -> Void = { () -> Void in
881
881
  do {
882
882
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:202)
883
883
  var imageSourceChangeListener: ((Any?) throws -> Void)?
@@ -1035,7 +1035,7 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
1035
1035
  try jsSet(presentedSharedElement, "alpha", Double(0))
1036
1036
  __continue2()
1037
1037
  } catch {
1038
- { __async2.throwValue($0) }(jsCaught(error))
1038
+ __async2.throwValue(jsCaught(error))
1039
1039
  }
1040
1040
  }
1041
1041
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:197)
@@ -1052,12 +1052,12 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
1052
1052
  "present")) as? JSPromise<Void>) as Any?),
1053
1053
  { (__t_2: Any?) -> Void in
1054
1054
  __next2()
1055
- }, { __async2.throwValue($0) })
1055
+ }, __async2.throwValue)
1056
1056
  } else {
1057
1057
  __next2()
1058
1058
  }
1059
1059
  } catch {
1060
- { __async2.throwValue($0) }(jsCaught(error))
1060
+ __async2.throwValue(jsCaught(error))
1061
1061
  }
1062
1062
  }
1063
1063
  }
@@ -1102,10 +1102,10 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
1102
1102
  }
1103
1103
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:296)
1104
1104
  var __it12 = orphanTags.makeIterator()
1105
- let __break3: () -> Void = { () -> Void in
1105
+ let __break3: @MainActor () -> Void = { () -> Void in
1106
1106
  __async3.returnValue(())
1107
1107
  }
1108
- JSAsyncLoop().run { (__continue3: @escaping () -> Void) -> Void in
1108
+ JSAsyncLoop().run { (__continue3: @escaping @MainActor () -> Void) -> Void in
1109
1109
  do {
1110
1110
  guard let __item3 = __it12.next() else {
1111
1111
  __break3()
@@ -1158,7 +1158,7 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
1158
1158
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:310)
1159
1159
  let independentSharedElement: UIView? =
1160
1160
  try jsUnwrap(independentView, "ios").ios as? UIView
1161
- let __next3: () -> Void = { () -> Void in
1161
+ let __next3: @MainActor () -> Void = { () -> Void in
1162
1162
  do {
1163
1163
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:316)
1164
1164
  let snapshot: UIImageView? = try UIImageView(
@@ -1300,7 +1300,7 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
1300
1300
  0
1301
1301
  __continue3()
1302
1302
  } catch {
1303
- { __async3.throwValue($0) }(jsCaught(error))
1303
+ __async3.throwValue(jsCaught(error))
1304
1304
  }
1305
1305
  }
1306
1306
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:312)
@@ -1317,12 +1317,12 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
1317
1317
  "present")) as? JSPromise<Void>) as Any?),
1318
1318
  { (__t_3: Any?) -> Void in
1319
1319
  __next3()
1320
- }, { __async3.throwValue($0) })
1320
+ }, __async3.throwValue)
1321
1321
  } else {
1322
1322
  __next3()
1323
1323
  }
1324
1324
  } catch {
1325
- { __async3.throwValue($0) }(jsCaught(error))
1325
+ __async3.throwValue(jsCaught(error))
1326
1326
  }
1327
1327
  }
1328
1328
  }
@@ -2028,16 +2028,16 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
2028
2028
  __async1.returnValue(())
2029
2029
  return
2030
2030
  } catch {
2031
- { __async1.throwValue($0) }(jsCaught(error))
2031
+ __async1.throwValue(jsCaught(error))
2032
2032
  }
2033
- }, { __async1.throwValue($0) })
2033
+ }, __async1.throwValue)
2034
2034
  } catch {
2035
- { __async1.throwValue($0) }(jsCaught(error))
2035
+ __async1.throwValue(jsCaught(error))
2036
2036
  }
2037
- }, { __async1.throwValue($0) })
2037
+ }, __async1.throwValue)
2038
2038
  }
2039
2039
  } catch {
2040
- { __async1.throwValue($0) }(jsCaught(error))
2040
+ __async1.throwValue(jsCaught(error))
2041
2041
  }
2042
2042
  }
2043
2043
  __clause1()
@@ -2782,8 +2782,8 @@ open class SharedTransitionHelper: JSDynamic, JSExpando, JSStaticKeyed {
2782
2782
  let destSharedIos: UIView? = try (jsGetIfPresent(jsGetIfPresent(destPresented, "view"), "ios") as? UIView)
2783
2783
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:1040)
2784
2784
  let containerView: UIView? = try
2785
- (((jsGet(interactiveState, "transitionContext") as? any UIViewControllerContextTransitioning))
2786
- as any UIViewControllerContextTransitioning?)?.containerView
2785
+ (((jsGet(interactiveState, "transitionContext") as? (any UIViewControllerContextTransitioning)))
2786
+ as (any UIViewControllerContextTransitioning)?)?.containerView
2787
2787
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:1041)
2788
2788
  var targetTransform: Any? = jsNull
2789
2789
  #sourceLocation(file:"@nativescript/core/ui.transition.shared-transition-helper.ios.ts",line:1042)
@@ -523,7 +523,7 @@ open class WebView: WebViewBase {
523
523
  }
524
524
  #sourceLocation()
525
525
  open override func jsSymbolMethod(_ key: String) -> JSMethod? {
526
- if key == ((Core_ui_web_view_web_view_common.disableZoomProperty?.setNative)?.key ?? "undefined") {
526
+ if key == (try? ((Core_ui_web_view_web_view_common.disableZoomProperty?.setNative)?.key ?? "undefined")) {
527
527
  return { __this, __a in
528
528
  try (jsCastPresent(__this) as WebView).symbol_setNative_disableZoom(
529
529
  (try jsConvertedBool(jsArg(__a, 0))))
@@ -88,10 +88,10 @@ open class WebViewBase: ContainerView {
88
88
  }
89
89
  #sourceLocation()
90
90
  open override func jsSymbolMethod(_ key: String) -> JSMethod? {
91
- if key == ((Core_ui_web_view_web_view_common.srcProperty?.getDefault)?.key ?? "undefined") {
91
+ if key == (try? ((Core_ui_web_view_web_view_common.srcProperty?.getDefault)?.key ?? "undefined")) {
92
92
  return { __this, __a in return try (jsCastPresent(__this) as WebViewBase).symbol_getDefault_src() }
93
93
  }
94
- if key == ((Core_ui_web_view_web_view_common.srcProperty?.setNative)?.key ?? "undefined") {
94
+ if key == (try? ((Core_ui_web_view_web_view_common.srcProperty?.setNative)?.key ?? "undefined")) {
95
95
  return { __this, __a in
96
96
  try (jsCastPresent(__this) as WebViewBase).symbol_setNative_src((try jsConvertedString(jsArg(__a, 0))))
97
97
  return nil
@@ -0,0 +1,77 @@
1
+ // Generated from @nativescript/core by tools/kit: edit core, not this file.
2
+
3
+ import CFNetwork
4
+ import CoreFoundation
5
+ import CoreGraphics
6
+ import CoreServices
7
+ import CoreText
8
+ import Dispatch
9
+ import Foundation
10
+ import ObjectiveC
11
+ import Photos
12
+ import QuartzCore
13
+ import Symbols
14
+ import SystemConfiguration
15
+ import UIKit
16
+ import WebKit
17
+
18
+ public enum Core_utils_android_runtime_version {
19
+ public static let semverPattern: JSRegExp = jsRegExpLiteral(
20
+ "^(\\d+)\\.(\\d+)\\.(\\d+)(-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$", "")
21
+ /// Whether a `major.minor.patch[-prerelease]` version string is at or above the given release.
22
+ /// Prereleases of the release itself are lower than it, as in semver.
23
+ /// @param version Version to test; anything that is not a parsable version string yields false.
24
+ /// @returns True only for a parsable version at or above `major.minor.patch`.
25
+ public static func isVersionAtLeast(_ version: Any?, _ major: Double, _ minor: Double, _ patch: Double) throws
26
+ -> Bool
27
+ {
28
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:10)
29
+ if !jsStringEquals(jsTypeof(version), "string") {
30
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:11)
31
+ return false
32
+ }
33
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:13)
34
+ let match: JSMatch? = Core_utils_android_runtime_version.semverPattern.exec(jsLenientString(version))
35
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:14)
36
+ if !jsTruthy(match as Any?) {
37
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:15)
38
+ return false
39
+ }
40
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:17)
41
+ let parts: JSArray<Double> = try JSArray<Double>([
42
+ jsNumberFromString(((jsUnwrap(match, "1").values.element(1) ?? nil) ?? "undefined")),
43
+ jsNumberFromString(((jsUnwrap(match, "2").values.element(2) ?? nil) ?? "undefined")),
44
+ jsNumberFromString(((jsUnwrap(match, "3").values.element(3) ?? nil) ?? "undefined")),
45
+ ])
46
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:18)
47
+ let target: JSArray<Double> = JSArray<Double>([major, minor, patch])
48
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:19)
49
+ var i: Double = 0
50
+ while i < parts.length {
51
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:20)
52
+ if !jsLenientNumberEquals((parts.element(i) ?? .nan), (target.element(i) ?? .nan)) {
53
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:21)
54
+ return (parts.element(i) ?? .nan) > (target.element(i) ?? .nan)
55
+ }
56
+ i += 1
57
+ }
58
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:25)
59
+ return try (jsUnwrap(match, "4").values.element(4) ?? nil) == nil
60
+ }
61
+ #sourceLocation()
62
+ public static var typedArrayToByteArray: Bool? = nil
63
+ /// Whether the Android runtime copies a typed array passed to a Java `byte[]` parameter.
64
+ /// Older runtimes mis-pass it, so this is gated on the version rather than probed.
65
+ public static func runtimeCopiesTypedArraysToByteArrays() throws -> Bool {
66
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:35)
67
+ if Core_utils_android_runtime_version.typedArrayToByteArray == nil {
68
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:36)
69
+ Core_utils_android_runtime_version.typedArrayToByteArray =
70
+ try Core_utils_android_runtime_version.isVersionAtLeast(
71
+ jsGet(jsGlobalThis, "__runtimeVersion"), 9, 1, 2)
72
+ }
73
+ #sourceLocation(file:"@nativescript/core/utils.android-runtime-version.ts",line:39)
74
+ return (Core_utils_android_runtime_version.typedArrayToByteArray ?? false)
75
+ }
76
+ }
77
+ #sourceLocation()
@@ -167,11 +167,11 @@ open class ScopeError: JSError, JSStaticKeyed {
167
167
  return jsTruthy(__v_1 as Any?) ? __v_1 : nil
168
168
  }()) as Any?)
169
169
  }
170
- super.init(jsLenientString(formattedMessage))
170
+ super.init(try jsConvertedString(formattedMessage))
171
171
  #sourceLocation(file:"@nativescript/core/utils.debug-source.ts",line:84)
172
172
  self.stack = try jsUnwrap(inner, "stack").stack
173
173
  #sourceLocation(file:"@nativescript/core/utils.debug-source.ts",line:85)
174
- self.message = jsLenientString(formattedMessage)
174
+ self.message = try jsConvertedString(formattedMessage)
175
175
  }
176
176
  #sourceLocation()
177
177
  open override var jsKeys: [String] { super.jsKeys }
@@ -152,13 +152,13 @@ public enum Utils {
152
152
  try
153
153
  ({ (success: Bool) throws -> Void in
154
154
  #sourceLocation(file:"@nativescript/core/utils.index.ios.ts",line:97)
155
- __resolvers1.resolve(success)
155
+ try __resolvers1.resolve(success)
156
156
  })(success)
157
157
  }
158
158
  })
159
159
  } else {
160
160
  #sourceLocation(file:"@nativescript/core/utils.index.ios.ts",line:100)
161
- __resolvers1.resolve(false)
161
+ try __resolvers1.resolve(false)
162
162
  }
163
163
  } catch {
164
164
  #sourceLocation()
@@ -412,92 +412,100 @@ open class XMLHttpRequest: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
412
412
  } else if data is JSArrayBuffer {
413
413
  #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:247)
414
414
  try jsSet(self._options, "content", (data as? JSArrayBuffer))
415
+ } else if JSArrayBuffer.isView(data) {
416
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:249)
417
+ try jsSet(
418
+ self._options, "content",
419
+ JSUint8Array.from(
420
+ jsUnwrap(data as? JSArrayBufferView, "buffer").buffer,
421
+ jsUnwrap(data as? JSArrayBufferView, "byteOffset").byteOffset,
422
+ jsUnwrap(data as? JSArrayBufferView, "byteLength").byteLength))
415
423
  }
416
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:250)
417
- self._sendFlag = true
418
424
  #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:252)
419
- try self.emitEvent("loadstart", JSArray<Any?>())
425
+ self._sendFlag = true
420
426
  #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:254)
427
+ try self.emitEvent("loadstart", JSArray<Any?>())
428
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:256)
421
429
  _ = try jsUnwrap(
422
430
  jsUnwrap(Core_http_http_request_index.request(self._options), "then").then({ (r: Any?) throws -> Void in
423
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:256)
431
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:258)
424
432
  if !self._errorFlag && self._sendFlag {
425
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:257)
433
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:259)
426
434
  try self._loadResponse(r)
427
435
  }
428
436
  }), "catch"
429
437
  ).catch({ (e: Any?) throws -> Void in
430
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:261)
438
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:263)
431
439
  self._errorFlag = true
432
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:262)
440
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:264)
433
441
  self._sendFlag = false
434
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:263)
442
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:265)
435
443
  try self._setRequestError("error", e)
436
444
  })
437
445
  }
438
446
  #sourceLocation()
439
447
  open func setRequestHeader(_ header: String, _ value: String) throws {
440
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:268)
448
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:270)
441
449
  if !jsLenientNumberEquals(self._readyState, self.OPENED) || self._sendFlag {
442
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:269)
450
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:271)
443
451
  throw JSException(
444
452
  value: JSError(
445
453
  "Failed to execute 'setRequestHeader' on 'XMLHttpRequest': " + "The object's state must be OPENED.")
446
454
  )
447
455
  }
448
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:272)
456
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:274)
449
457
  if Core_utils_types.isString(header) && Core_utils_types.isString(value) {
450
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:273)
458
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:275)
451
459
  try jsSet(jsGet(self._options, "headers"), header, value)
452
460
  }
453
461
  }
454
462
  #sourceLocation()
455
463
  open func getAllResponseHeaders() throws -> String {
456
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:278)
464
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:280)
457
465
  if self._readyState < 2 || self._errorFlag {
458
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:279)
466
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:281)
459
467
  return ""
460
468
  }
461
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:282)
462
- var result: String = ""
463
469
  #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:284)
470
+ var result: String = ""
471
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:286)
464
472
  for i in jsKeysOf(self._headers) {
465
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:285)
473
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:287)
466
474
  try result += i + ": " + jsToStringDefaultThrowing(jsGet(self._headers, i)) + "\r\n"
467
475
  }
468
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:288)
476
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:290)
469
477
  return jsSubstr(result, 0, Double(result.utf16.count) - 2)
470
478
  }
471
479
  #sourceLocation()
472
480
  open func getResponseHeader(_ header: String) throws -> String? {
473
481
  var header = header
474
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:292)
482
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:294)
475
483
  if (Core_utils_types.isString(header) && self._readyState > 1 && jsTruthy(self._headers)) && !self._errorFlag {
476
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:293)
484
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:295)
477
485
  header = header.lowercased()
478
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:294)
486
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:296)
479
487
  for i in jsKeysOf(self._headers) {
480
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:295)
488
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:297)
481
489
  if jsStringEquals(i.lowercased(), header) {
482
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:296)
490
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:298)
483
491
  return try jsConvertedStringOrNil(jsGet(self._headers, i))
484
492
  }
485
493
  }
486
494
  }
487
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:301)
495
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:303)
488
496
  return nil
489
497
  }
490
498
  #sourceLocation()
491
499
  open func overrideMimeType(_ mime: String) throws {
492
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:305)
500
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:307)
493
501
  if jsLenientNumberEquals(self._readyState, self.LOADING) || jsLenientNumberEquals(self._readyState, self.DONE) {
494
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:306)
502
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:308)
495
503
  throw JSException(
496
504
  value: JSError(
497
505
  "Failed to execute 'overrideMimeType' on 'XMLHttpRequest': "
498
506
  + "MimeType cannot be overridden when the state is LOADING or DONE."))
499
507
  }
500
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:309)
508
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:311)
501
509
  self._overrideMimeType = mime
502
510
  }
503
511
  #sourceLocation()
@@ -794,7 +802,7 @@ open class FormData: JSDynamic, JSStringConvertible, JSExpando, JSStaticKeyed {
794
802
  nonisolated deinit {}
795
803
  open var _data: JSMap<String, Any?>? = JSMap<String, Any?>()
796
804
  public init() {
797
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:360)
805
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:362)
798
806
  self._data = JSMap<String, Any?>()
799
807
  }
800
808
  #sourceLocation()
@@ -807,19 +815,19 @@ open class FormData: JSDynamic, JSStringConvertible, JSExpando, JSStaticKeyed {
807
815
  open var jsSymbolKeys: [String] { jsExpando?.jsSymbolKeys ?? [] }
808
816
  open func jsDeleteOwn(_ key: String) -> Bool { jsExpando?.delete(key) ?? true }
809
817
  open func append(_ name: String, _ value: Any?) throws {
810
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:364)
818
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:366)
811
819
  _ = try jsUnwrap(self._data, "set").set(name, value)
812
820
  }
813
821
  #sourceLocation()
814
822
  open func toString() throws -> String {
815
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:368)
816
- let arr: JSArray<String> = JSArray<String>()
817
823
  #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:370)
824
+ let arr: JSArray<String> = JSArray<String>()
825
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:372)
818
826
  try jsUnwrap(self._data, "forEach").forEach { (value: Any?, name: String, map: JSMap<String, Any?>) -> Void in
819
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:371)
827
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:373)
820
828
  _ = arr.push("\(jsEncodeURIComponent(name))=\(jsEncodeURIComponent(jsToString(value)))")
821
829
  }
822
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:374)
830
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:376)
823
831
  return arr.join("&")
824
832
  }
825
833
  #sourceLocation()
@@ -877,7 +885,7 @@ open class BlobInternalAccessor: JSDynamic, JSExpando, JSConstructibleType, JSSt
877
885
  open var jsSymbolKeys: [String] { jsExpando?.jsSymbolKeys ?? [] }
878
886
  open func jsDeleteOwn(_ key: String) -> Bool { jsExpando?.delete(key) ?? true }
879
887
  open class func getBuffer(_ blob: Blob?) throws -> JSUint8Array? {
880
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:381)
888
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:383)
881
889
  return try jsUnwrap(blob, "_buffer")._buffer
882
890
  }
883
891
  #sourceLocation()
@@ -904,41 +912,34 @@ open class Blob: JSDynamic, JSStringConvertible, JSToStringTag, JSExpando, JSKey
904
912
  open var _type: String = ""
905
913
  open var jsToStringTag: String = "Blob"
906
914
  public init(_ chunks: JSArray<Any?>? = nil, _ opts: Any? = nil) throws {
907
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:399)
915
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:401)
908
916
  let chunks: JSArray<Any?> = chunks ?? JSArray<Any?>()
909
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:399)
917
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:401)
910
918
  let opts: Any? = opts ?? JSObject([])
911
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:400)
919
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:402)
912
920
  let dataChunks: JSArray<JSUint8Array> = JSArray<JSUint8Array>()
913
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:401)
921
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:403)
914
922
  for chunk in try jsIterated(chunks, "chunks is not iterable") {
915
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:402)
923
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:404)
916
924
  if chunk is Blob {
917
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:403)
925
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:405)
918
926
  _ = try dataChunks.push(
919
927
  jsObjectRequired(jsUnwrap(jsShaped(chunk) { try NativeScriptKit.Blob() }, "_buffer")._buffer))
920
928
  } else if jsStringEquals(jsTypeof(chunk), "string") {
921
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:405)
929
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:407)
922
930
  let textEncoder: JSTextEncoder = JSTextEncoder()
923
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:406)
924
- _ = try dataChunks.push(jsObjectRequired(textEncoder.encode(jsLenientString(chunk))))
925
- } else if chunk is JSDataView {
926
931
  #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:408)
927
- _ = try dataChunks.push(
928
- JSUint8Array.from(jsCallMethod(jsUnwrap(chunk as? JSDataView, "buffer").buffer, "slice", Double(0)))
929
- )
930
- } else if (chunk is JSArrayBuffer) || JSArrayBuffer.isView((chunk as? JSArrayBufferView)) {
932
+ _ = try dataChunks.push(jsObjectRequired(textEncoder.encode(jsLenientString(chunk))))
933
+ } else if (chunk is JSArrayBuffer) || JSArrayBuffer.isView(chunk) {
931
934
  #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:410)
932
935
  _ = try dataChunks.push(
933
- JSUint8Array(
934
- buffer: jsObjectRequired(
935
- (JSArrayBuffer.isView(chunk)
936
- ? jsObjectRequired(
937
- jsUnwrap(
938
- jsUnwrap(chunk as? JSArrayBufferView, "buffer").buffer as? JSArrayBuffer,
939
- "slice"
940
- ).slice(0)) : jsObjectRequired(jsUnwrap(chunk as? JSArrayBuffer, "slice").slice(0)))
941
- )))
936
+ JSUint8Array.from(
937
+ (JSArrayBuffer.isView(chunk)
938
+ ? jsCallMethod(
939
+ jsGet(chunk, "buffer"), "slice", jsGet(chunk, "byteOffset"),
940
+ jsConvertedNumber(jsGet(chunk, "byteOffset"))
941
+ + jsConvertedNumber(jsGet(chunk, "byteLength")))
942
+ : (jsObjectRequired(jsUnwrap(chunk as? JSArrayBuffer, "slice").slice(0)) as Any?))))
942
943
  } else {
943
944
  #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:412)
944
945
  let textEncoder: JSTextEncoder = JSTextEncoder()
@@ -988,12 +989,12 @@ open class Blob: JSDynamic, JSStringConvertible, JSToStringTag, JSExpando, JSKey
988
989
  }
989
990
  #sourceLocation()
990
991
  open var size: Double {
991
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:393)
992
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:395)
992
993
  return self._size
993
994
  }
994
995
  #sourceLocation()
995
996
  open var type: String {
996
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:396)
997
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:398)
997
998
  return self._type
998
999
  }
999
1000
  #sourceLocation()
@@ -1671,7 +1672,7 @@ public func __init_Core_xhr_index() {
1671
1672
  guard let __o = __this as? XMLHttpRequest else { throw JSException(JSTypeError("Illegal invocation")) }
1672
1673
  return __o.statusText
1673
1674
  }, set: nil)
1674
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:379)
1675
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:381)
1675
1676
  JSPrototypes.declareStatics(
1676
1677
  BlobInternalAccessor.self,
1677
1678
  [
@@ -1682,7 +1683,7 @@ public func __init_Core_xhr_index() {
1682
1683
  }
1683
1684
  )
1684
1685
  ])
1685
- #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:385)
1686
+ #sourceLocation(file:"@nativescript/core/xhr.index.ts",line:387)
1686
1687
  JSPrototypes.declare(
1687
1688
  Blob.self, "size",
1688
1689
  get: { (__this: Any?) throws -> Any? in
@@ -1267,6 +1267,10 @@ extension JSArray: JSArrayViewing {
1267
1267
  static func jsViewing(_ source: JSArrayProtocol) -> AnyObject { source.jsView(as: Element.self) }
1268
1268
  }
1269
1269
 
1270
+ extension Optional: JSArrayViewing where Wrapped: JSArrayViewing {
1271
+ static func jsViewing(_ source: JSArrayProtocol) -> AnyObject { Wrapped.jsViewing(source) }
1272
+ }
1273
+
1270
1274
  /// An array type an array of another element type, whose elements it can hold, becomes, keeping that array as its view.
1271
1275
  protocol JSArrayAdopting {
1272
1276
  static func jsAdopt(_ plain: JSArrayAdoptable) -> AnyObject?
@@ -252,6 +252,7 @@ public func jsDefineProperty(_ object: Any?, _ key: String, _ descriptor: Any?)
252
252
 
253
253
  /// An object of a program class whose declared fields `Object.defineProperty` may give a descriptor (an accessor, read-only,
254
254
  /// hidden): such a field's reads and writes go through `subscript(jsKey:)`, which defers to the descriptor kept beside the object.
255
+ @MainActor
255
256
  public protocol JSDefinable: JSDynamic {
256
257
  func jsDefinable(_ key: String) -> Bool
257
258
  }
@@ -399,6 +400,7 @@ public func jsObjectFromEntries<S: Sequence>(_ entries: S) throws -> JSRecord<An
399
400
  }
400
401
 
401
402
  /// An object that can lose an own property (`delete o.x`).
403
+ @MainActor
402
404
  public protocol JSDeletable: AnyObject {
403
405
  func jsDeleteOwn(_ key: String) -> Bool
404
406
  }