@nstudio/nativescript-compiler 9.2.0-alpha.10 → 9.2.0-alpha.12

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 (181) hide show
  1. package/dist/api/ir.js +7 -1
  2. package/dist/cli/runtime.cjs +7 -1
  3. package/dist/css/css.js +30 -6
  4. package/dist/driver/cli.js +2 -0
  5. package/dist/driver/compile.js +23 -10
  6. package/dist/driver/paths.js +7 -0
  7. package/dist/driver/unimplemented.js +15 -0
  8. package/dist/kotlin/access.js +23 -5
  9. package/dist/kotlin/arguments.js +5 -0
  10. package/dist/kotlin/builtins.js +0 -4
  11. package/dist/kotlin/calls.js +6 -2
  12. package/dist/kotlin/class-methods.js +9 -3
  13. package/dist/kotlin/components.js +13 -8
  14. package/dist/kotlin/conversion.js +17 -5
  15. package/dist/kotlin/core-api.js +2 -13
  16. package/dist/kotlin/declarations.js +2 -0
  17. package/dist/kotlin/expression-statements.js +5 -4
  18. package/dist/kotlin/expressions.js +8 -3
  19. package/dist/kotlin/functions.js +13 -4
  20. package/dist/kotlin/global-calls.js +11 -0
  21. package/dist/kotlin/literals.js +58 -14
  22. package/dist/kotlin/names.js +2 -2
  23. package/dist/kotlin/native/api.js +9 -1
  24. package/dist/kotlin/native/calls.js +84 -3
  25. package/dist/kotlin/native/subclasses.js +4 -3
  26. package/dist/kotlin/native/types.js +8 -5
  27. package/dist/kotlin/operators.js +4 -1
  28. package/dist/kotlin/overrides.js +7 -5
  29. package/dist/kotlin/placement.js +3 -1
  30. package/dist/kotlin/prototype-calls.js +5 -0
  31. package/dist/kotlin/render.js +62 -0
  32. package/dist/kotlin/statements.js +9 -0
  33. package/dist/kotlin/static-calls.js +10 -7
  34. package/dist/kotlin/translator.js +31 -11
  35. package/dist/kotlin/type-facts.js +10 -2
  36. package/dist/kotlin/types.js +6 -6
  37. package/dist/plugins/native-android.js +37 -5
  38. package/dist/plugins/native-ios.js +2 -0
  39. package/dist/plugins/source.js +73 -23
  40. package/dist/program/app-modules.js +91 -16
  41. package/dist/program/app-paths.js +80 -12
  42. package/dist/program/class-mixins.js +463 -0
  43. package/dist/program/core-facts.js +7 -0
  44. package/dist/program/glob.js +274 -0
  45. package/dist/program/platform.js +32 -4
  46. package/dist/program/program.js +239 -38
  47. package/dist/program/source-lines.js +4 -1
  48. package/dist/program/vite-plugins.js +144 -0
  49. package/dist/semantics/apis/globals.js +2 -2
  50. package/dist/semantics/apis/object.js +1 -0
  51. package/dist/semantics/apis/statics.js +6 -0
  52. package/dist/semantics/ast.js +20 -2
  53. package/dist/semantics/classes.js +36 -1
  54. package/dist/semantics/facts.js +28 -1
  55. package/dist/semantics/globals.js +3 -0
  56. package/dist/semantics/lang.js +13 -1
  57. package/dist/semantics/nullish.js +29 -11
  58. package/dist/semantics/refuse-receivers.js +3 -3
  59. package/dist/semantics/refuse-scope.js +2 -7
  60. package/dist/semantics/runtime.js +1 -0
  61. package/dist/semantics/shapes.js +21 -1
  62. package/dist/semantics/states/value-states.js +1 -1
  63. package/dist/semantics/throws.js +1 -0
  64. package/dist/semantics/translator-methods.js +1 -1
  65. package/dist/semantics/types.js +21 -1
  66. package/dist/swift/access.js +25 -10
  67. package/dist/swift/arguments.js +10 -2
  68. package/dist/swift/assignment.js +12 -1
  69. package/dist/swift/builtins.js +0 -4
  70. package/dist/swift/calls.js +6 -2
  71. package/dist/swift/class-methods.js +3 -3
  72. package/dist/swift/components.js +28 -8
  73. package/dist/swift/construction.js +4 -0
  74. package/dist/swift/conversion.js +1 -1
  75. package/dist/swift/core-api.js +9 -12
  76. package/dist/swift/from-any.js +2 -2
  77. package/dist/swift/functions.js +13 -2
  78. package/dist/swift/generics.js +5 -1
  79. package/dist/swift/global-calls.js +2 -0
  80. package/dist/swift/literals.js +57 -10
  81. package/dist/swift/modules.js +1 -1
  82. package/dist/swift/names.js +1 -1
  83. package/dist/swift/native/sdk-tables.js +52 -4
  84. package/dist/swift/native/sdk.js +9 -1
  85. package/dist/swift/operators.js +4 -1
  86. package/dist/swift/parameters.js +5 -2
  87. package/dist/swift/placement.js +44 -4
  88. package/dist/swift/prototype-calls.js +17 -2
  89. package/dist/swift/render.js +64 -0
  90. package/dist/swift/results.js +1 -1
  91. package/dist/swift/statements.js +9 -0
  92. package/dist/swift/static-calls.js +13 -6
  93. package/dist/swift/types.js +9 -9
  94. package/dist/targets/android/build.js +18 -12
  95. package/dist/targets/ios/build.js +11 -10
  96. package/dist/targets/ios/dependencies.js +12 -0
  97. package/dist/targets/resources.js +15 -1
  98. package/dist/template/plan.js +105 -8
  99. package/dist/types/adapter-api.d.ts +13 -0
  100. package/dist/types/ir.d.ts +47 -0
  101. package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +102 -7485
  102. package/kit-android/generated/kotlin/org/nativescript/kit/application_application.kt +4 -4
  103. package/kit-android/generated/kotlin/org/nativescript/kit/image_source_index.kt +1 -1
  104. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_common.kt +7 -3
  105. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_index.kt +3 -1
  106. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +2 -4
  107. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_index.kt +5 -6
  108. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_common.kt +1 -3
  109. package/kit-android/generated/kotlin/org/nativescript/kit/ui_dialogs_index.kt +11 -6
  110. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment_transitions.kt +1 -1
  111. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_common.kt +1 -1
  112. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_helper_for_android.kt +7 -5
  113. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_index.kt +6 -3
  114. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_touch_manager.kt +1 -1
  115. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_flexbox_layout_index.kt +1 -1
  116. package/kit-android/generated/kotlin/org/nativescript/kit/ui_search_bar_index.kt +4 -3
  117. package/kit-android/generated/kotlin/org/nativescript/kit/ui_segmented_bar_index.kt +2 -2
  118. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_formatted_string.kt +1 -3
  119. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_index.kt +1 -1
  120. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_fade_transition.kt +1 -1
  121. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_flip_transition.kt +8 -8
  122. package/kit-android/generated/kotlin/org/nativescript/kit/utils_index.kt +1 -1
  123. package/kit-android/generated/source-lines.json +1 -1
  124. package/kit-android/gradlew.bat +94 -0
  125. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/CoreBridge.kt +67 -1
  126. package/kit-android/src/main/kotlin/org/nativescript/kit/Signals.kt +15 -2
  127. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Prototypes.kt +26 -0
  128. package/kit-apple/Overlays/xml-free/Core/ui.core.bindable.index.swift +4 -4
  129. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +26 -161
  130. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +9 -284
  131. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +11 -7
  132. package/kit-apple/Sources/NativeScriptKit/Core/Object_callback_thisArg_once.swift +1 -1
  133. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +7 -5
  134. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +4 -2
  135. package/kit-apple/Sources/NativeScriptKit/Core/{Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_91b5f3.swift → Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_fa18e1.swift} +28 -103
  136. package/kit-apple/Sources/NativeScriptKit/Core/__Namespace.Utils.swift +17 -15
  137. package/kit-apple/Sources/NativeScriptKit/Core/application-settings.index.ios.swift +8 -8
  138. package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +4 -4
  139. package/kit-apple/Sources/NativeScriptKit/Core/color.color-common.swift +7 -7
  140. package/kit-apple/Sources/NativeScriptKit/Core/data.observable.index.swift +3 -3
  141. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +2 -1
  142. package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +1 -1
  143. package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +40 -246
  144. package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +1 -2
  145. package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.index.ios.swift +3 -3
  146. package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +4 -4
  147. package/kit-apple/Sources/NativeScriptKit/Core/ui.content-view.index.swift +8 -8
  148. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.index.swift +4 -4
  149. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +8 -8
  150. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -3
  151. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.view-helper-common.swift +7 -7
  152. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.weak-event-listener.index.swift +3 -3
  153. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +4 -4
  154. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.index.ios.swift +2 -2
  155. package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.index.ios.swift +4 -4
  156. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.image-common.swift +2 -2
  157. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +4 -4
  158. package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +4 -4
  159. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.absolute-layout.index.ios.swift +4 -4
  160. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.dock-layout.index.ios.swift +4 -4
  161. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +3 -3
  162. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.grid-layout.index.ios.swift +4 -4
  163. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.stack-layout.index.ios.swift +4 -4
  164. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.wrap-layout.index.ios.swift +4 -4
  165. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +3 -3
  166. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +4 -4
  167. package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +10 -6
  168. package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +4 -4
  169. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +4 -4
  170. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +1 -1
  171. package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +4 -4
  172. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +2 -1
  173. package/kit-apple/Sources/NativeScriptKit/Core/utils.common.swift +9 -9
  174. package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.index.ios.swift +10 -10
  175. package/kit-apple/Sources/NativeScriptKit/CoreBridge.swift +67 -1
  176. package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +4 -0
  177. package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +25 -0
  178. package/kit-apple/Sources/NativeScriptKit/Runtime/RegExp.swift +6 -0
  179. package/kit-apple/Sources/NativeScriptKit/Signals.swift +20 -2
  180. package/package.json +2 -1
  181. package/kit-apple/Sources/NativeScriptKit/Core/Object_toString_charAt_charCodeAt_concat_indexOf_lastIndexOf_and_44_more_fc25df.swift +0 -481
@@ -399,16 +399,16 @@ open class AndroidApplication : ApplicationCommon {
399
399
  BroadcastReceiverImpl(onReceiveCallback)
400
400
  }
401
401
  if (Core_utils_constants.SDK_VERSION >= 26.0) {
402
- ((context ?: jsCannotRead("registerReceiver")).registerReceiver(
402
+ (context ?: jsCannotRead("registerReceiver")).registerReceiver(
403
403
  receiver,
404
404
  IntentFilter(intentFilter),
405
405
  flags.toLong().toInt(),
406
- ) ?: jsObjectRequired())
406
+ )
407
407
  } else {
408
- ((context ?: jsCannotRead("registerReceiver")).registerReceiver(
408
+ (context ?: jsCannotRead("registerReceiver")).registerReceiver(
409
409
  receiver,
410
410
  IntentFilter(intentFilter),
411
- ) ?: jsObjectRequired())
411
+ )
412
412
  }
413
413
  val receiverInfo: Any? =
414
414
  jsObjectOf(
@@ -563,7 +563,7 @@ open class ImageSource : JSExpando, JSKeysMade {
563
563
  val bitmapDrawable: BitmapDrawable? =
564
564
  ((res ?: jsCannotRead("getDrawable")).getDrawable(
565
565
  identifier.toLong().toInt()
566
- ) as BitmapDrawable)
566
+ ) as? BitmapDrawable)
567
567
  if (
568
568
  (jsTruthy(bitmapDrawable) &&
569
569
  jsTruthy(
@@ -192,7 +192,9 @@ abstract class AnimationBase : JSExpando, JSKeysMade {
192
192
  val r: Any? =
193
193
  jsCallMethod(_then, "apply", promise, __arguments)
194
194
  (_this ?: jsCannotRead("fixupAnimationPromise"))
195
- .fixupAnimationPromise(jsUnlessNullish(r) { jsPromiseOf<Unit>(it) })
195
+ .fixupAnimationPromise(
196
+ jsUnlessNullish(r) { jsPromiseOf<Unit>(it) { Unit } }
197
+ )
196
198
  return r
197
199
  }
198
200
  JSMethod { _, __a -> __f(jsArrayOf<Any?>(*__a)) }
@@ -209,7 +211,9 @@ abstract class AnimationBase : JSExpando, JSKeysMade {
209
211
  val r: Any? =
210
212
  jsCallMethod(_catch, "apply", promise, __arguments)
211
213
  (_this ?: jsCannotRead("fixupAnimationPromise"))
212
- .fixupAnimationPromise(jsUnlessNullish(r) { jsPromiseOf<Unit>(it) })
214
+ .fixupAnimationPromise(
215
+ jsUnlessNullish(r) { jsPromiseOf<Unit>(it) { Unit } }
216
+ )
213
217
  return r
214
218
  }
215
219
  JSMethod { _, __a -> __f(jsArrayOf<Any?>(*__a)) }
@@ -262,7 +266,7 @@ abstract class AnimationBase : JSExpando, JSKeysMade {
262
266
  "fixupAnimationPromise" ->
263
267
  jsFunction { __a ->
264
268
  this.fixupAnimationPromise(
265
- jsUnlessNullish(__a.getOrNull(0)) { jsPromiseOf<Unit>(it) }
269
+ jsUnlessNullish(__a.getOrNull(0)) { jsPromiseOf<Unit>(it) { Unit } }
266
270
  )
267
271
  null
268
272
  }
@@ -1176,7 +1176,9 @@ open class Animation : AnimationBase {
1176
1176
  jsConvertedNumberOrNull(jsGet(propertyAnimation, "iterations")) != null &&
1177
1177
  (animators.element(i) is ValueAnimator)
1178
1178
  ) {
1179
- (((animators.element(i) ?: jsObjectRequired()) as ValueAnimator))
1179
+ (jsUnchecked<ValueAnimator>(
1180
+ ((animators.element(i) ?: jsObjectRequired()) as? ValueAnimator)
1181
+ ))
1180
1182
  .setRepeatCount(
1181
1183
  Core_ui_animation_index.getAndroidRepeatCount(
1182
1184
  (jsConvertedNumberOrNull(jsGet(propertyAnimation, "iterations"))
@@ -891,14 +891,12 @@ abstract class ViewBase : Observable, JSStringConvertible {
891
891
 
892
892
  /** Returns the child view with the specified id. */
893
893
  open fun getViewById(id: String?): Any? {
894
- return (Core_ui_core_view_base_index.getViewById(this, id)
895
- ?: jsObjectRequired())
894
+ return Core_ui_core_view_base_index.getViewById(this, id)
896
895
  }
897
896
 
898
897
  /** Returns the child view with the specified domId. */
899
898
  open fun getViewByDomId(domId: Double): Any? {
900
- return (Core_ui_core_view_base_index.getViewByDomId(this, domId)
901
- ?: jsObjectRequired())
899
+ return Core_ui_core_view_base_index.getViewByDomId(this, domId)
902
900
  }
903
901
 
904
902
  /** @unstable Ensures a dom-node for this view. */
@@ -1164,7 +1164,7 @@ open class View : ViewCommon {
1164
1164
  open fun clearInsetListener() {
1165
1165
  this.insetListenerIsSet = false
1166
1166
  val nativeView: Any? =
1167
- (jsCast(this.nativeViewProtected, android_view_View::class.java) ?: jsObjectRequired())
1167
+ jsCast(this.nativeViewProtected, android_view_View::class.java)
1168
1168
  if (jsTruthy(jsGetOptional(nativeView, "setInsetListener"))) {
1169
1169
  jsCallMethod(nativeView, "setInsetListener", jsNull)
1170
1170
  }
@@ -1208,7 +1208,7 @@ open class View : ViewCommon {
1208
1208
  .getChildFragmentManager()
1209
1209
  break
1210
1210
  }
1211
- val fragments: Any? = (view ?: jsObjectRequired())
1211
+ val fragments: Any? = view
1212
1212
  if (jsTruthy(jsGet(fragments, "_hasFragments"))) {
1213
1213
  if (frameOrTabViewItemFound) {
1214
1214
  manager =
@@ -1232,7 +1232,7 @@ open class View : ViewCommon {
1232
1232
 
1233
1233
  open fun __symbol_androidOverflowEdgeProperty_setNative(value: String?) {
1234
1234
  val nativeView: Any? =
1235
- (jsCast(this.nativeViewProtected, android_view_View::class.java) ?: jsObjectRequired())
1235
+ jsCast(this.nativeViewProtected, android_view_View::class.java)
1236
1236
  if (
1237
1237
  jsTypeof(value) != "string" ||
1238
1238
  jsStrictEquals(nativeView, jsNull) ||
@@ -2846,8 +2846,7 @@ open class View : ViewCommon {
2846
2846
  (fun() {
2847
2847
  var backgroundDrawable: Drawable? = backgroundDrawable
2848
2848
  val nativeView: Any? =
2849
- (jsCast(this.nativeViewProtected, android_view_View::class.java)
2850
- ?: jsObjectRequired())
2849
+ jsCast(this.nativeViewProtected, android_view_View::class.java)
2851
2850
  if (onlyColor) {
2852
2851
  val backgroundColor: Double =
2853
2852
  ((background ?: jsCannotRead("color")).color ?: jsCannotRead("android")).android
@@ -2989,7 +2988,7 @@ open class View : ViewCommon {
2989
2988
 
2990
2989
  open fun onBackgroundOrBorderPropertyChanged() {
2991
2990
  val nativeView: Any? =
2992
- (jsCast(this.nativeViewProtected, android_view_View::class.java) ?: jsObjectRequired())
2991
+ jsCast(this.nativeViewProtected, android_view_View::class.java)
2993
2992
  if (!jsTruthy(nativeView)) {
2994
2993
  return
2995
2994
  }
@@ -3506,9 +3506,7 @@ object Core_ui_core_view_view_common {
3506
3506
  __o_4["valueConverter"] =
3507
3507
  fun(value: String?): Any? {
3508
3508
  if (Core_utils_types.isObject(value)) {
3509
- return (value
3510
- as
3511
- Object_toString_charAt_charCodeAt_concat_indexOf_lastIndexOf_loc_50)
3509
+ return value
3512
3510
  } else {
3513
3511
  return Core_ui_core_view_base_utils
3514
3512
  .booleanConverter(value)
@@ -6,6 +6,7 @@ import android.content.Context
6
6
  import android.content.DialogInterface
7
7
  import android.graphics.Typeface
8
8
  import android.text.InputType
9
+ import android.view.View as android_view_View
9
10
  import android.widget.Button as android_widget_Button
10
11
  import android.widget.EditText
11
12
  import android.widget.LinearLayout
@@ -59,8 +60,9 @@ object Core_ui_dialogs_index {
59
60
  .toDouble()
60
61
  if (jsTruthy(textViewId)) {
61
62
  val tv: android_widget_TextView? =
62
- ((dlg ?: jsCannotRead("findViewById")).findViewById(textViewId.toLong().toInt())
63
- as android_widget_TextView)
63
+ ((dlg ?: jsCannotRead("findViewById")).findViewById<android_view_View>(
64
+ textViewId.toLong().toInt()
65
+ ) as? android_widget_TextView)
64
66
  if (jsTruthy(tv)) {
65
67
  (tv ?: jsCannotRead("setTextColor")).setTextColor(
66
68
  (labelColor ?: jsCannotRead("android")).android.toLong().toInt()
@@ -75,9 +77,9 @@ object Core_ui_dialogs_index {
75
77
  .toDouble()
76
78
  if (jsTruthy(messageTextViewId)) {
77
79
  val messageTextView: android_widget_TextView? =
78
- ((dlg ?: jsCannotRead("findViewById")).findViewById(
80
+ ((dlg ?: jsCannotRead("findViewById")).findViewById<android_view_View>(
79
81
  messageTextViewId.toLong().toInt()
80
- ) as android_widget_TextView)
82
+ ) as? android_widget_TextView)
81
83
  if (jsTruthy(messageTextView)) {
82
84
  (messageTextView ?: jsCannotRead("setTextColor")).setTextColor(
83
85
  (labelColor ?: jsCannotRead("android")).android.toLong().toInt()
@@ -101,8 +103,11 @@ object Core_ui_dialogs_index {
101
103
  .getIdentifier("android:id/button" + js(i), null, null)
102
104
  .toDouble()
103
105
  buttons[i] =
104
- ((dlg ?: jsCannotRead("findViewById")).findViewById(id.toLong().toInt())
105
- as android_widget_Button)
106
+ jsUnchecked<android_widget_Button>(
107
+ ((dlg ?: jsCannotRead("findViewById")).findViewById<android_view_View>(
108
+ id.toLong().toInt()
109
+ ) as? android_widget_Button)
110
+ )
106
111
  i += 1.0
107
112
  }
108
113
  buttons.forEach({ button: android_widget_Button? ->
@@ -1518,7 +1518,7 @@ object Core_ui_frame_fragment_transitions {
1518
1518
  jsSet(values, js(0.0), 0.0)
1519
1519
  jsSet(values, js(1.0), 1.0)
1520
1520
  val animator: Animator? =
1521
- (ObjectAnimator.ofFloat((null as Any?), "alpha", *(values as FloatArray)) as Animator)
1521
+ (ObjectAnimator.ofFloat((null as Any?), "alpha", *(values as FloatArray)) as? Animator)
1522
1522
  (animator ?: jsCannotRead("setDuration")).setDuration(duration.toLong())
1523
1523
  jsSet(objectAnimators, js(0.0), animator)
1524
1524
  animatorSet.playTogether(*(jsAs<Array<Animator>>(objectAnimators)))
@@ -783,7 +783,7 @@ open class FrameBase : CustomLayoutView {
783
783
  if (
784
784
  (jsTruthy(this.currentPage) &&
785
785
  Core_ui_core_view_view_common.viewMatchesModuleContext(
786
- jsCast((this.currentPage ?: jsObjectRequired()), ViewCommon::class.java),
786
+ jsCast(this.currentPage, ViewCommon::class.java),
787
787
  context,
788
788
  jsArrayOf<String>("markup", "script"),
789
789
  ))
@@ -183,11 +183,13 @@ open class FragmentCallbacksImplementation : JSExpando, JSKeysMade {
183
183
  }
184
184
  val savedState: Any? = jsGet(entry, "viewSavedState")
185
185
  if (jsTruthy(savedState)) {
186
- (((jsCast(
187
- (page ?: jsCannotRead("nativeViewProtected")).nativeViewProtected,
188
- org_nativescript_widgets_GridLayout::class.java,
189
- ) ?: jsObjectRequired())
190
- as android_view_View))
186
+ (jsUnchecked<android_view_View>(
187
+ ((jsCast(
188
+ (page ?: jsCannotRead("nativeViewProtected")).nativeViewProtected,
189
+ org_nativescript_widgets_GridLayout::class.java,
190
+ ) ?: jsObjectRequired())
191
+ as? android_view_View)
192
+ ))
191
193
  .restoreHierarchyState(jsAs<SparseArray<Parcelable>?>(savedState))
192
194
  jsSet(entry, "viewSavedState", jsNull)
193
195
  }
@@ -95,8 +95,9 @@ open class Frame : FrameBase {
95
95
  (jsCastCarried(
96
96
  jsCallOptional(
97
97
  jsJavaGet(
98
- ((((activity ?: jsObjectRequired()) as FragmentActivity))
99
- ?: jsObjectRequired()),
98
+ ((jsUnchecked<FragmentActivity>(
99
+ ((activity ?: jsObjectRequired()) as? FragmentActivity)
100
+ )) ?: jsObjectRequired()),
100
101
  "getLifecycle",
101
102
  )
102
103
  ),
@@ -1864,7 +1865,9 @@ object Core_ui_frame_index {
1864
1865
  JSWeakRef<AppCompatActivity>(jsWeakRefTarget(activity)),
1865
1866
  )
1866
1867
  jsSet((activity ?: jsObjectRequired()), "_onBackPressed", true)
1867
- (((activity ?: jsObjectRequired()) as ComponentActivity))
1868
+ (jsUnchecked<ComponentActivity>(
1869
+ ((activity ?: jsObjectRequired()) as? ComponentActivity)
1870
+ ))
1868
1871
  .onBackPressedDispatcher
1869
1872
  .addCallback(
1870
1873
  (activity ?: jsObjectRequired()),
@@ -266,7 +266,7 @@ object Core_ui_gestures_touch_manager {
266
266
  lateinit var touchState: JSSymbol
267
267
 
268
268
  fun getTouchState(view: View?): Any? {
269
- val holder: Any? = (view ?: jsObjectRequired())
269
+ val holder: Any? = view
270
270
  if (!jsTruthy(jsGet(holder, Core_ui_gestures_touch_manager.touchState.key))) {
271
271
  jsSet(holder, Core_ui_gestures_touch_manager.touchState.key, jsObjectOf())
272
272
  }
@@ -184,7 +184,7 @@ open class FlexboxLayout : FlexboxLayoutBase {
184
184
  (child ?: jsCannotRead("nativeViewProtected")).nativeViewProtected,
185
185
  android_view_View::class.java,
186
186
  ) ?: jsCannotRead("getLayoutParams"))
187
- .getLayoutParams() as org_nativescript_widgets_FlexboxLayout.LayoutParams)
187
+ .getLayoutParams() as? org_nativescript_widgets_FlexboxLayout.LayoutParams)
188
188
  val style: Style? = (child ?: jsCannotRead("style")).style
189
189
  (lp ?: jsCannotSet("order")).order =
190
190
  (style ?: jsCannotRead("order")).order.toLong().toInt()
@@ -375,7 +375,7 @@ open class SearchBar : SearchBarBase {
375
375
  val closeButton: ImageView? =
376
376
  ((jsCast(this.nativeViewProtected, SearchView::class.java)
377
377
  ?: jsCannotRead("findViewById"))
378
- .findViewById(closeButtonId.toLong().toInt()) as ImageView)
378
+ .findViewById<android_view_View>(closeButtonId.toLong().toInt()) as? ImageView)
379
379
  val color: Double =
380
380
  (if (jsIs<Color>(value)) jsCastCarried(value, Color::class.java).android
381
381
  else Color(JSArray<Any?>(listOf<Any?>(value))).android)
@@ -407,7 +407,8 @@ open class SearchBar : SearchBarBase {
407
407
  this._searchTextView =
408
408
  ((jsCast(this.nativeViewProtected, SearchView::class.java)
409
409
  ?: jsCannotRead("findViewById"))
410
- .findViewById(id.toLong().toInt()) as android_widget_TextView)
410
+ .findViewById<android_view_View>(id.toLong().toInt())
411
+ as? android_widget_TextView)
411
412
  }
412
413
  return this._searchTextView
413
414
  }
@@ -429,7 +430,7 @@ open class SearchBar : SearchBarBase {
429
430
  this._searchPlate =
430
431
  ((jsCast(this.nativeViewProtected, SearchView::class.java)
431
432
  ?: jsCannotRead("findViewById"))
432
- .findViewById(id.toLong().toInt()) as LinearLayout)
433
+ .findViewById<android_view_View>(id.toLong().toInt()) as? LinearLayout)
433
434
  }
434
435
  return this._searchPlate
435
436
  }
@@ -232,7 +232,7 @@ open class SegmentedBarItem : SegmentedBarItemBase {
232
232
  val viewGroup: ViewGroup? =
233
233
  ((jsCast(this.nativeViewProtected, android_widget_TextView::class.java)
234
234
  ?: jsCannotRead("getParent"))
235
- .getParent() as ViewGroup)
235
+ .getParent() as? ViewGroup)
236
236
  return (viewGroup ?: jsCannotRead("getBackground")).getBackground()
237
237
  }
238
238
 
@@ -240,7 +240,7 @@ open class SegmentedBarItem : SegmentedBarItemBase {
240
240
  val nativeView: android_widget_TextView? =
241
241
  jsCast(this.nativeViewProtected, android_widget_TextView::class.java)
242
242
  val viewGroup: ViewGroup? =
243
- ((nativeView ?: jsCannotRead("getParent")).getParent() as ViewGroup)
243
+ ((nativeView ?: jsCannotRead("getParent")).getParent() as? ViewGroup)
244
244
  if ((value is Color)) {
245
245
  val color: Double = jsCastCarried(value, Color::class.java).android
246
246
  val backgroundDrawable: Drawable? =
@@ -166,9 +166,7 @@ open class FormattedString : ViewBase {
166
166
  .getItem(jsConvertedNumberOrZero(jsGet(eventData, "index")) + i),
167
167
  Span::class.java,
168
168
  )
169
- this._addView(
170
- jsCast((span ?: jsObjectRequired()), ViewBase::class.java)
171
- )
169
+ this._addView(jsCast(span, ViewBase::class.java))
172
170
  this.addPropertyChangeHandler(span)
173
171
  i += 1.0
174
172
  }
@@ -554,7 +554,7 @@ open class TextBase : TextBaseCommon {
554
554
  jsCallMethod(
555
555
  (nativeView as android_widget_TextView?),
556
556
  "setText",
557
- jsNulled((spannableStringBuilder ?: jsObjectRequired())),
557
+ jsNulled(spannableStringBuilder),
558
558
  )
559
559
  this._setTappableState(Core_ui_text_base_index.isStringTappable(value))
560
560
  (Core_ui_text_base_text_base_common.textProperty.nativeValueChange
@@ -28,7 +28,7 @@ open class FadeTransition : Transition {
28
28
  }
29
29
  val animator: Animator? =
30
30
  (ObjectAnimator.ofFloat((null as Any?), "alpha", *(alphaValues as FloatArray))
31
- as Animator)
31
+ as? Animator)
32
32
  val duration: Double = this.getDuration_()
33
33
  (animator ?: jsCannotRead("setDuration")).setDuration(duration.toLong())
34
34
  (animator ?: jsCannotRead("setInterpolator")).setInterpolator(
@@ -40,7 +40,7 @@ open class FlipTransition : Transition {
40
40
  "rotationY",
41
41
  *(((toJavaValue(values, FloatArray::class.java) as FloatArray?)
42
42
  as FloatArray?) ?: jsObjectRequired()),
43
- ) as Animator)
43
+ ) as? Animator)
44
44
  (animator ?: jsCannotRead("setInterpolator")).setInterpolator(
45
45
  interpolator
46
46
  )
@@ -58,7 +58,7 @@ open class FlipTransition : Transition {
58
58
  "alpha",
59
59
  *(((toJavaValue(values, FloatArray::class.java) as FloatArray?)
60
60
  as FloatArray?) ?: jsObjectRequired()),
61
- ) as Animator)
61
+ ) as? Animator)
62
62
  (animator ?: jsCannotRead("setDuration")).setDuration(
63
63
  (fullDuration / 2.0).toLong()
64
64
  )
@@ -75,7 +75,7 @@ open class FlipTransition : Transition {
75
75
  "rotationY",
76
76
  *(((toJavaValue(values, FloatArray::class.java) as FloatArray?)
77
77
  as FloatArray?) ?: jsObjectRequired()),
78
- ) as Animator)
78
+ ) as? Animator)
79
79
  (animator ?: jsCannotRead("setInterpolator")).setInterpolator(
80
80
  interpolator
81
81
  )
@@ -93,7 +93,7 @@ open class FlipTransition : Transition {
93
93
  "alpha",
94
94
  *(((toJavaValue(values, FloatArray::class.java) as FloatArray?)
95
95
  as FloatArray?) ?: jsObjectRequired()),
96
- ) as Animator)
96
+ ) as? Animator)
97
97
  (animator ?: jsCannotRead("setDuration")).setDuration(
98
98
  (fullDuration / 2.0).toLong()
99
99
  )
@@ -110,7 +110,7 @@ open class FlipTransition : Transition {
110
110
  "rotationY",
111
111
  *(((toJavaValue(values, FloatArray::class.java) as FloatArray?)
112
112
  as FloatArray?) ?: jsObjectRequired()),
113
- ) as Animator)
113
+ ) as? Animator)
114
114
  (animator ?: jsCannotRead("setInterpolator")).setInterpolator(
115
115
  interpolator
116
116
  )
@@ -128,7 +128,7 @@ open class FlipTransition : Transition {
128
128
  "alpha",
129
129
  *(((toJavaValue(values, FloatArray::class.java) as FloatArray?)
130
130
  as FloatArray?) ?: jsObjectRequired()),
131
- ) as Animator)
131
+ ) as? Animator)
132
132
  (animator ?: jsCannotRead("setDuration")).setDuration(
133
133
  (fullDuration / 2.0).toLong()
134
134
  )
@@ -145,7 +145,7 @@ open class FlipTransition : Transition {
145
145
  "rotationY",
146
146
  *(((toJavaValue(values, FloatArray::class.java) as FloatArray?)
147
147
  as FloatArray?) ?: jsObjectRequired()),
148
- ) as Animator)
148
+ ) as? Animator)
149
149
  (animator ?: jsCannotRead("setInterpolator")).setInterpolator(
150
150
  interpolator
151
151
  )
@@ -163,7 +163,7 @@ open class FlipTransition : Transition {
163
163
  "alpha",
164
164
  *(((toJavaValue(values, FloatArray::class.java) as FloatArray?)
165
165
  as FloatArray?) ?: jsObjectRequired()),
166
- ) as Animator)
166
+ ) as? Animator)
167
167
  (animator ?: jsCannotRead("setDuration")).setDuration(
168
168
  (fullDuration / 2.0).toLong()
169
169
  )
@@ -265,7 +265,7 @@ object Core_utils_index {
265
265
  jsCallMethodIfPresent(
266
266
  jsGetOptional(
267
267
  ((Core_ui_frame_frame_stack.topmost()?._modalParent
268
- ?: ((Core_ui_frame_frame_stack.topmost()?.modal ?: jsObjectRequired())))),
268
+ ?: (Core_ui_frame_frame_stack.topmost()?.modal))),
269
269
  "_dialogFragment",
270
270
  ),
271
271
  "getDialog",