@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
@@ -55,5 +55,23 @@ public enum Core_http_http_request_internal_http_request_internal_common {
55
55
  #sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:22)
56
56
  return JSObject([("method", method as Any?)])
57
57
  }
58
+ #sourceLocation()
59
+ public static func getRequestBodyBytes(_ content: Any?) throws -> JSUint8Array? {
60
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:26)
61
+ if content is JSArrayBuffer {
62
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:27)
63
+ return try JSUint8Array(buffer: (jsCastPresent(content) as JSArrayBuffer))
64
+ }
65
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:29)
66
+ if JSArrayBuffer.isView(content) {
67
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:30)
68
+ return try JSUint8Array.from(
69
+ jsUnwrap(content as? JSArrayBufferView, "buffer").buffer,
70
+ jsUnwrap(content as? JSArrayBufferView, "byteOffset").byteOffset,
71
+ jsUnwrap(content as? JSArrayBufferView, "byteLength").byteLength)
72
+ }
73
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:33)
74
+ return nil
75
+ }
58
76
  }
59
77
  #sourceLocation()
@@ -157,38 +157,53 @@ public enum Core_http_http_request_internal_index {
157
157
  (jsObjectRequired(
158
158
  (NSString(string: jsLenientString(jsCallMethod(jsGet(options, "content"), "toString")))
159
159
  .data(using: 4) as NSData?)) as Data?)
160
- } else if try (jsGet(options, "content") is JSArrayBuffer) {
160
+ } else {
161
161
  #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:91)
162
- let buffer: JSArrayBuffer? = try jsGet(options, "content") as? JSArrayBuffer
162
+ let bytes: JSUint8Array? =
163
+ try Core_http_http_request_internal_http_request_internal_common.getRequestBodyBytes(
164
+ jsGet(options, "content"))
163
165
  #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:92)
164
- try jsUnwrap(urlRequest, setting: "HTTPBody").httpBody =
165
- (NSData(data: jsNativeData(jsObjectRequired(buffer))) as Data?)
166
+ if jsTruthy(bytes) {
167
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:93)
168
+ let __d_1: JSUint8Array = try jsDestructured(bytes, "buffer")
169
+ let buffer: Any? = __d_1.buffer
170
+ let byteOffset: Double = __d_1.byteOffset
171
+ let byteLength: Double = __d_1.byteLength
172
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:94)
173
+ let body: Any? =
174
+ try
175
+ (byteOffset == 0 && jsStrictEquals(byteLength, jsGet(buffer, "byteLength"))
176
+ ? buffer : jsCallMethod(buffer, "slice", byteOffset, byteOffset + byteLength))
177
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:95)
178
+ try jsUnwrap(urlRequest, setting: "HTTPBody").httpBody =
179
+ (NSData(data: jsNativeData(body)) as Data?)
180
+ }
166
181
  }
167
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:95)
182
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:99)
168
183
  if try Core_utils_types.isNumber(jsGet(options, "timeout")) {
169
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:96)
184
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:100)
170
185
  try jsUnwrap(urlRequest, setting: "timeoutInterval").timeoutInterval = jsNativeNumber(
171
186
  jsConvertedNumber(jsGet(options, "timeout")) / 1000)
172
187
  }
173
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:99)
188
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:103)
174
189
  var session: URLSession?
175
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:100)
190
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:104)
176
191
  if try Core_utils_types.isBoolean(jsGet(options, "dontFollowRedirects"))
177
192
  && jsConvertedBool(jsGet(options, "dontFollowRedirects"))
178
193
  {
179
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:101)
194
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:105)
180
195
  try Core_http_http_request_internal_index.ensureSessionNotFollowingRedirects()
181
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:102)
196
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:106)
182
197
  session = Core_http_http_request_internal_index.sessionNotFollowingRedirects
183
198
  } else {
184
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:104)
199
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:108)
185
200
  try Core_http_http_request_internal_index.ensureDefaultSession()
186
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:105)
201
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:109)
187
202
  session = Core_http_http_request_internal_index.defaultSession
188
203
  }
189
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:108)
204
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:112)
190
205
  var timestamp: Double = -1
191
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:109)
206
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:113)
192
207
  let dataTask: URLSessionDataTask? = try jsUnwrap(session, "dataTaskWithRequestCompletionHandler")
193
208
  .dataTask(
194
209
  with: (jsObjectRequired(urlRequest) as URLRequest),
@@ -199,24 +214,24 @@ public enum Core_http_http_request_internal_index {
199
214
  jsReport {
200
215
  try
201
216
  ({ (data: NSData?, response: HTTPURLResponse?, error: NSError?) throws -> Void in
202
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:110)
217
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:114)
203
218
  if jsTruthy(error) {
204
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:111)
219
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:115)
205
220
  try jsCallable(reject, "reject")(
206
221
  JSError(jsUnwrap(error, "localizedDescription").localizedDescription))
207
222
  } else {
208
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:113)
223
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:117)
209
224
  let headers: JSRecord<Any?> = JSRecord<Any?>()
210
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:114)
225
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:118)
211
226
  if try
212
227
  (jsTruthy(response)
213
228
  && jsTruthy(jsUnwrap(response, "allHeaderFields").allHeaderFields))
214
229
  {
215
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:115)
230
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:119)
216
231
  let headerFields: [AnyHashable: Any] = try jsUnwrap(
217
232
  response, "allHeaderFields"
218
233
  ).allHeaderFields
219
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:117)
234
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:121)
220
235
  try
221
236
  (jsUnwrap(headerFields, "enumerateKeysAndObjectsUsingBlock")
222
237
  as NSDictionary).enumerateKeysAndObjects(
@@ -231,7 +246,7 @@ public enum Core_http_http_request_internal_index {
231
246
  ({
232
247
  (key: Any?, value: Any?, stop: Any?) throws
233
248
  -> Void in
234
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:118)
249
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:122)
235
250
  try
236
251
  Core_http_http_request_internal_http_request_internal_common
237
252
  .addHeader(
@@ -241,14 +256,14 @@ public enum Core_http_http_request_internal_index {
241
256
  }
242
257
  })
243
258
  }
244
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:122)
259
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:126)
245
260
  if jsTruthy(debugRequest) {
246
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:123)
261
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:127)
247
262
  try jsSet(
248
263
  debugRequest, "mimeType", jsUnwrap(response, "MIMEType").mimeType)
249
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:124)
264
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:128)
250
265
  try jsSet(debugRequest, "data", data)
251
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:125)
266
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:129)
252
267
  let debugResponse:
253
268
  Object_url_status_statusText_headers_mimeType_fromDiskCache_timing_headersSize =
254
269
  try
@@ -273,12 +288,12 @@ public enum Core_http_http_request_internal_index {
273
288
  headersSize: jsNullishCoalesce(
274
289
  ((headers as JSRecord<Any?>?)?["length"] ?? nil),
275
290
  Double(-1)))
276
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:151)
291
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:155)
277
292
  _ = try jsCallMethod(debugRequest, "responseReceived", debugResponse)
278
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:152)
293
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:156)
279
294
  _ = try jsCallMethod(debugRequest, "loadingFinished")
280
295
  }
281
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:156)
296
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:160)
282
297
  let content: Any? = try JSObject([
283
298
  ("raw", data), ("requestURL", jsGet(options, "url")),
284
299
  (
@@ -286,13 +301,13 @@ public enum Core_http_http_request_internal_index {
286
301
  FunctionCell_none_to_JSPromise_AnyOpt_Opt.scriptOrNil(
287
302
  "", 0,
288
303
  { () -> JSPromise<Any?> in
289
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:160)
304
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:164)
290
305
  return JSPromise<Any?> {
291
306
  (__resolvers2: JSResolvers<Any?>) throws -> Void in
292
307
  let rejectImage: (Any?) -> Void = {
293
308
  __resolvers2.reject($0)
294
309
  }
295
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:161)
310
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:165)
296
311
  UIImage.tns_decode(
297
312
  with: (data as Data?),
298
313
  completion: jsEnter { (__b0: UIImage?) -> Void in
@@ -300,12 +315,12 @@ public enum Core_http_http_request_internal_index {
300
315
  jsReport {
301
316
  try
302
317
  ({ (image: UIImage?) throws -> Void in
303
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:162)
318
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:166)
304
319
  if jsTruthy(image) {
305
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:163)
320
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:167)
306
321
  __resolvers2.resolve(image)
307
322
  } else {
308
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:165)
323
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:169)
309
324
  try jsCallable(
310
325
  rejectImage, "rejectImage")(
311
326
  JSError(
@@ -323,22 +338,22 @@ public enum Core_http_http_request_internal_index {
323
338
  FunctionCell_DoubleOpt_to_String.scriptOrNil(
324
339
  "", 1,
325
340
  { (encoding: Double?) throws -> String in
326
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:170)
341
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:174)
327
342
  return
328
343
  try Core_http_http_request_internal_index.NSDataToString(
329
344
  data, encoding)
330
345
  })
331
346
  ),
332
347
  ])
333
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:173)
348
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:177)
334
349
  if try !jsIsNullish(contentHandler)
335
350
  && Core_utils_types.isObject(contentHandler)
336
351
  && !(JSArray<Any?>.isArray(contentHandler))
337
352
  {
338
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:174)
353
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:178)
339
354
  _ = try jsObjectAssign(content, contentHandler)
340
355
  }
341
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:177)
356
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:181)
342
357
  try __resolvers1.resolve(
343
358
  JSObject([
344
359
  ("content", content),
@@ -349,11 +364,11 @@ public enum Core_http_http_request_internal_index {
349
364
  })(data, response, error)
350
365
  }
351
366
  })
352
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:185)
367
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:189)
353
368
  if try (jsTruthy(jsGet(options, "url")) && jsTruthy(debugRequest)) {
354
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:186)
369
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:190)
355
370
  timestamp = JSDate.now() / 1000
356
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:187)
371
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:191)
357
372
  let request: Object_headers_timestamp_headersSize_method_postData_url = try {
358
373
  () throws -> Object_headers_timestamp_headersSize_method_postData_url in
359
374
  let __spread1: Any? =
@@ -371,37 +386,37 @@ public enum Core_http_http_request_internal_index {
371
386
  ? jsLenientString(jsField(__spread1, "url")) : jsLenientString(jsGet(options, "url"))),
372
387
  jsOrder: ["url", "method", "postData", "headers", "timestamp", "headersSize"])
373
388
  }()
374
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:194)
389
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:198)
375
390
  _ = try jsCallMethod(debugRequest, "requestWillBeSent", request)
376
391
  }
377
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:197)
392
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:201)
378
393
  try jsUnwrap(dataTask, "resume").resume()
379
394
  } catch {
380
395
  let ex: Any? = jsCaught(error)
381
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:199)
396
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:203)
382
397
  try jsCallable(reject, "reject")(ex)
383
398
  }
384
399
  }
385
400
  }
386
401
  #sourceLocation()
387
402
  public static func NSDataToString(_ data: Any?, _ encoding: Double? = nil) throws -> String {
388
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:205)
403
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:209)
389
404
  var code: Double = Double(NSUTF8StringEncoding)
390
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:207)
405
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:211)
391
406
  if jsLenientNumberEquals((encoding ?? .nan), HttpResponseEncoding.GBK) {
392
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:208)
407
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:212)
393
408
  code = Double(CFStringEncodings.GB_18030_2000.rawValue)
394
409
  }
395
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:211)
410
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:215)
396
411
  var encodedString: NSString? = NSString(data: jsNativeData(data), encoding: jsNativeInteger(code, UInt.self))
397
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:214)
412
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:218)
398
413
  if !jsTruthy(encodedString) {
399
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:215)
414
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:219)
400
415
  code = Double(NSISOLatin1StringEncoding)
401
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:216)
416
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:220)
402
417
  encodedString = jsImplicit(NSString(data: jsNativeData(data), encoding: jsNativeInteger(code, UInt.self)))
403
418
  }
404
- #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:219)
419
+ #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:223)
405
420
  return try jsUnwrap(encodedString, "toString").description
406
421
  }
407
422
  }
@@ -219,40 +219,48 @@ open class ImageSource: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
219
219
  open class func fromResource(_ name: String) throws -> JSPromise<ImageSource>? {
220
220
  #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:120)
221
221
  return JSPromise<ImageSource> { (__resolvers3: JSResolvers<ImageSource>) throws -> Void in
222
-
223
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:122)
224
- UIImage.tns_safeDecodeNamed(
225
- name,
226
- completion: jsEnter { (__b0: UIImage?) -> Void in
227
- let image: UIImage? = __b0
228
- jsReport {
229
- try
230
- ({ (image: UIImage?) throws -> Void in
231
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:123)
232
- if jsTruthy(image) {
233
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:124)
234
- try __resolvers3.resolve(ImageSource(image))
235
- } else {
236
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:126)
237
- UIImage.tns_safeDecodeNamed(
238
- "\(name).jpg",
239
- completion: jsEnter { (__b0: UIImage?) -> Void in
240
- let img: UIImage? = __b0
241
- jsReport {
242
- try
243
- ({ (img: UIImage?) throws -> Void in
244
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:127)
245
- if jsTruthy(img) {
246
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:128)
247
- try __resolvers3.resolve(ImageSource(img))
248
- }
249
- })(img)
250
- }
251
- })
252
- }
253
- })(image)
254
- }
255
- })
222
+ let reject: (Any?) -> Void = { __resolvers3.reject($0) }
223
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:121)
224
+ do {
225
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:122)
226
+ UIImage.tns_safeDecodeNamed(
227
+ name,
228
+ completion: jsEnter { (__b0: UIImage?) -> Void in
229
+ let image: UIImage? = __b0
230
+ jsReport {
231
+ try
232
+ ({ (image: UIImage?) throws -> Void in
233
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:123)
234
+ if jsTruthy(image) {
235
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:124)
236
+ try __resolvers3.resolve(ImageSource(image))
237
+ } else {
238
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:126)
239
+ UIImage.tns_safeDecodeNamed(
240
+ "\(name).jpg",
241
+ completion: jsEnter { (__b0: UIImage?) -> Void in
242
+ let img: UIImage? = __b0
243
+ jsReport {
244
+ try
245
+ ({ (img: UIImage?) throws -> Void in
246
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:127)
247
+ if jsTruthy(img) {
248
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:128)
249
+ try __resolvers3.resolve(ImageSource(img))
250
+ }
251
+ })(img)
252
+ }
253
+ })
254
+ }
255
+ })(image)
256
+ }
257
+ })
258
+ } catch {
259
+ #sourceLocation()
260
+ let ex: Any? = jsCaught(error)
261
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:134)
262
+ try jsCallable(reject, "reject")(ex)
263
+ }
256
264
  }
257
265
  }
258
266
  #sourceLocation()
@@ -333,23 +341,31 @@ open class ImageSource: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
333
341
  open class func fromData(_ data: Any?) throws -> JSPromise<ImageSource>? {
334
342
  #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:182)
335
343
  return JSPromise<ImageSource> { (__resolvers5: JSResolvers<ImageSource>) throws -> Void in
336
-
337
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:184)
338
- UIImage.tns_decode(
339
- with: jsNativeData(data),
340
- completion: jsEnter { (__b0: UIImage?) -> Void in
341
- let uiImage: UIImage? = __b0
342
- jsReport {
343
- try
344
- ({ (uiImage: UIImage?) throws -> Void in
345
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:185)
346
- if jsTruthy(uiImage) {
347
- #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:186)
348
- try __resolvers5.resolve(ImageSource(uiImage))
349
- }
350
- })(uiImage)
351
- }
352
- })
344
+ let reject: (Any?) -> Void = { __resolvers5.reject($0) }
345
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:183)
346
+ do {
347
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:184)
348
+ UIImage.tns_decode(
349
+ with: jsNativeData(data),
350
+ completion: jsEnter { (__b0: UIImage?) -> Void in
351
+ let uiImage: UIImage? = __b0
352
+ jsReport {
353
+ try
354
+ ({ (uiImage: UIImage?) throws -> Void in
355
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:185)
356
+ if jsTruthy(uiImage) {
357
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:186)
358
+ try __resolvers5.resolve(ImageSource(uiImage))
359
+ }
360
+ })(uiImage)
361
+ }
362
+ })
363
+ } catch {
364
+ #sourceLocation()
365
+ let ex: Any? = jsCaught(error)
366
+ #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:190)
367
+ try jsCallable(reject, "reject")(ex)
368
+ }
353
369
  }
354
370
  }
355
371
  #sourceLocation()
@@ -710,8 +710,15 @@ open class EasySAXParser: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
710
710
  #sourceLocation(file:"@nativescript/core/js-libs.easysax.easysax.ts",line:541)
711
711
  if self.is_onComment && !stop {
712
712
  #sourceLocation(file:"@nativescript/core/js-libs.easysax.easysax.ts",line:542)
713
- ok = try jsCallee(
714
- FunctionCell_String_AnyOpt_to_String_Opt_to_AnyOpt_Opt_to_AnyOpt.present(self.onComment))(
713
+ ok = try
714
+ ({ () throws -> (String, ((Any?) throws -> String)?, (() throws -> Any?)?) throws -> Any in
715
+ guard
716
+ let __fn =
717
+ try FunctionCell_String_AnyOpt_to_String_Opt_to_AnyOpt_Opt_to_AnyOpt.present(
718
+ self.onComment)
719
+ else { throw JSException(JSTypeError("this.onComment is not a function")) }
720
+ return __fn
721
+ }())(
715
722
  jsSubstring(xml, i + 4, j),
716
723
  FunctionCell_AnyOpt_to_String.declared(
717
724
  "Core_js_libs_easysax_easysax.unEntities",
@@ -739,8 +746,14 @@ open class EasySAXParser: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
739
746
  #sourceLocation(file:"@nativescript/core/js-libs.easysax.easysax.ts",line:556)
740
747
  if self.is_onAttention && !stop {
741
748
  #sourceLocation(file:"@nativescript/core/js-libs.easysax.easysax.ts",line:557)
742
- ok = try jsCallee(
743
- FunctionCell_String_AnyOpt_to_String_Opt_to_AnyOpt_Opt_to_AnyOpt.present(self.onAttention))(
749
+ ok = try
750
+ ({ () throws -> (String, ((Any?) throws -> String)?, (() throws -> Any?)?) throws -> Any in
751
+ guard
752
+ let __fn = try FunctionCell_String_AnyOpt_to_String_Opt_to_AnyOpt_Opt_to_AnyOpt.present(
753
+ self.onAttention)
754
+ else { throw JSException(JSTypeError("this.onAttention is not a function")) }
755
+ return __fn
756
+ }())(
744
757
  jsSubstring(xml, i, j + 1),
745
758
  FunctionCell_AnyOpt_to_String.declared(
746
759
  "Core_js_libs_easysax_easysax.unEntities",
@@ -770,8 +783,13 @@ open class EasySAXParser: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
770
783
  #sourceLocation(file:"@nativescript/core/js-libs.easysax.easysax.ts",line:572)
771
784
  if self.is_onQuestion {
772
785
  #sourceLocation(file:"@nativescript/core/js-libs.easysax.easysax.ts",line:573)
773
- ok = try jsCallee(FunctionCell_String_to_AnyOpt_Opt_to_AnyOpt.present(self.onQuestion))(
774
- jsSubstring(xml, i, j + 2), position(i))
786
+ ok = try
787
+ ({ () throws -> (String, (() throws -> Any?)?) throws -> Any in
788
+ guard
789
+ let __fn = try FunctionCell_String_to_AnyOpt_Opt_to_AnyOpt.present(self.onQuestion)
790
+ else { throw JSException(JSTypeError("this.onQuestion is not a function")) }
791
+ return __fn
792
+ }())(jsSubstring(xml, i, j + 2), position(i))
775
793
  #sourceLocation(file:"@nativescript/core/js-libs.easysax.easysax.ts",line:574)
776
794
  if jsStrictEquals(ok, false) {
777
795
  #sourceLocation(file:"@nativescript/core/js-libs.easysax.easysax.ts",line:574)