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

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 (71) hide show
  1. package/dist/kit/kit-index.js +9 -0
  2. package/dist/kotlin/access.js +7 -9
  3. package/dist/kotlin/arguments.js +2 -2
  4. package/dist/kotlin/class-accessors.js +1 -1
  5. package/dist/kotlin/class-declaration.js +23 -2
  6. package/dist/kotlin/class-methods.js +21 -11
  7. package/dist/kotlin/components.js +2 -7
  8. package/dist/kotlin/core-api.js +2 -21
  9. package/dist/kotlin/declarations.js +86 -9
  10. package/dist/kotlin/functions.js +1 -4
  11. package/dist/kotlin/global-calls.js +1 -4
  12. package/dist/kotlin/literals.js +3 -6
  13. package/dist/kotlin/names.js +2 -0
  14. package/dist/kotlin/native/classfiles.js +2 -13
  15. package/dist/kotlin/operators.js +12 -6
  16. package/dist/kotlin/optional-chains.js +2 -9
  17. package/dist/kotlin/overrides.js +3 -15
  18. package/dist/kotlin/placement.js +1 -12
  19. package/dist/kotlin/statements.js +1 -13
  20. package/dist/kotlin/translator.js +2 -10
  21. package/dist/kotlin/type-tests.js +1 -1
  22. package/dist/kotlin/types.js +2 -19
  23. package/dist/program/core-facts.js +9 -0
  24. package/dist/semantics/facts.js +37 -1
  25. package/dist/semantics/forms/by-name.js +18 -4
  26. package/dist/semantics/lang.js +36 -1
  27. package/dist/semantics/lower.js +90 -0
  28. package/dist/semantics/lowering-methods.js +115 -3
  29. package/dist/semantics/marks.js +30 -0
  30. package/dist/semantics/refusals.js +12 -11
  31. package/dist/semantics/tdz.js +103 -8
  32. package/dist/swift/access.js +6 -8
  33. package/dist/swift/assignment.js +10 -2
  34. package/dist/swift/calls.js +7 -2
  35. package/dist/swift/class-accessors.js +1 -1
  36. package/dist/swift/class-declaration.js +3 -2
  37. package/dist/swift/class-methods.js +16 -1
  38. package/dist/swift/classes.js +23 -9
  39. package/dist/swift/components.js +0 -4
  40. package/dist/swift/core-api.js +9 -29
  41. package/dist/swift/declarations.js +0 -5
  42. package/dist/swift/expression-statements.js +7 -0
  43. package/dist/swift/global-calls.js +0 -4
  44. package/dist/swift/lenient.js +3 -5
  45. package/dist/swift/method-values.js +1 -19
  46. package/dist/swift/modules.js +2 -0
  47. package/dist/swift/names.js +0 -9
  48. package/dist/swift/native/api.js +3 -1
  49. package/dist/swift/native/dispatch.js +2 -8
  50. package/dist/swift/operators.js +7 -6
  51. package/dist/swift/optional-chains.js +1 -8
  52. package/dist/swift/parameters.js +0 -4
  53. package/dist/swift/placement.js +7 -12
  54. package/dist/swift/protocols.js +25 -4
  55. package/dist/swift/results.js +0 -4
  56. package/dist/swift/statements.js +1 -13
  57. package/dist/swift/translator.js +0 -10
  58. package/dist/types/adapter-api.d.ts +3 -3
  59. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Array.kt +53 -12
  60. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/JSON.kt +30 -4
  61. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Language.kt +33 -0
  62. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Prototypes.kt +9 -1
  63. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Values.kt +137 -28
  64. package/kit-apple/Sources/NativeScriptKit/Core/color.color-common.swift +17 -0
  65. package/kit-apple/Sources/NativeScriptKit/Core/color.index.ios.swift +60 -0
  66. package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +24 -6
  67. package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +3 -3
  68. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.gestures-common.swift +2 -0
  69. package/kit-apple/Sources/NativeScriptKit/Runtime/JSON.swift +151 -82
  70. package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +13 -1
  71. package/package.json +1 -1
@@ -258,11 +258,12 @@ fun jsObjectOf(vararg entries: Pair<String, Any?>): JSObject = JSObject(*entries
258
258
  * ascending, then the other keys in insertion order.
259
259
  */
260
260
  class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConvertible {
261
- private val storage = HashMap<String, Any?>()
262
- private val indexKeys = ArrayList<Long>()
263
- private val namedKeys = ArrayList<String>()
261
+ internal val storage = HashMap<String, Any?>(8)
262
+ private var indexKeys: ArrayList<Long>? = null
263
+ internal val namedKeys = ArrayList<String>(8)
264
264
  /** Properties that are accessors or not plain writable, enumerable, configurable data. */
265
- private val slots = HashMap<String, JSPropertySlot>()
265
+ private var slots: HashMap<String, JSPropertySlot>? = null
266
+ private var hasSymbols = false
266
267
  var extensible = true
267
268
  private set
268
269
  var jsTracker: JSTracker? = null
@@ -273,6 +274,10 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
273
274
  /** What weak collections hold for this object as their key. */
274
275
  internal var weakSlots: JSWeakSlots? = null
275
276
 
277
+ /** True when this object has only plain enumerable string keys, no prototype, and no reactive tracker. */
278
+ internal val isPlainFast: Boolean
279
+ get() = indexKeys == null && !hasSymbols && slots == null && jsPrototype == null && jsTracker == null
280
+
276
281
  constructor(entries: List<Pair<String, Any?>>) : this() {
277
282
  for ((k, v) in entries) define(k, v)
278
283
  }
@@ -285,7 +290,8 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
285
290
  var jsPrototype: Any? = null
286
291
 
287
292
  operator fun get(key: String): Any? {
288
- if (slots.isNotEmpty()) slots[key]?.get?.let { return it(this) }
293
+ val s = slots
294
+ if (s != null && s.isNotEmpty()) s[key]?.get?.let { return it(this) }
289
295
  jsPrototype?.let { proto -> if (!storage.containsKey(key)) return jsBox(proto).let { p -> if (p is JSObject) p.get(key, this) else jsGet(p, key) } }
290
296
  val tracker = jsTracker ?: return storage[key]
291
297
  tracker.track()
@@ -294,7 +300,8 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
294
300
 
295
301
  /** `object[key]` read for `receiver`, which an accessor sees as `this` (an instance reading its prototype's). */
296
302
  fun get(key: String, receiver: Any?): Any? {
297
- if (slots.isNotEmpty()) slots[key]?.let { if (it.isAccessor) return it.get?.invoke(receiver) }
303
+ val s = slots
304
+ if (s != null && s.isNotEmpty()) s[key]?.let { if (it.isAccessor) return it.get?.invoke(receiver) }
298
305
  val proto = jsBox(jsPrototype)
299
306
  if (proto is JSObject && !storage.containsKey(key)) return proto.get(key, receiver)
300
307
  return this[key]
@@ -311,16 +318,30 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
311
318
  }
312
319
 
313
320
  /** The setter of an accessor property; it takes the receiver as `this`. */
314
- fun setter(key: String): ((Any?, Any?) -> Unit)? = slots[key]?.takeIf { it.isAccessor }?.set
321
+ fun setter(key: String): ((Any?, Any?) -> Unit)? = slots?.get(key)?.takeIf { it.isAccessor }?.set
315
322
 
316
323
  operator fun set(key: String, value: Any?) = put(key, value)
317
324
 
325
+ /** Fast property insertion for `JSON.parse` on a freshly created object. */
326
+ internal fun defineParsed(key: String, value: Any?) {
327
+ if (key.isEmpty() || key[0] !in '0'..'9') {
328
+ val existed = storage.containsKey(key)
329
+ storage[key] = value
330
+ if (!existed) {
331
+ namedKeys.add(key)
332
+ if (jsIsSymbolKey(key)) hasSymbols = true
333
+ }
334
+ } else {
335
+ define(key, value)
336
+ }
337
+ }
338
+
318
339
  /**
319
340
  * `object[key] = value` in strict code: a read-only property, a getter without a setter
320
341
  * or a new key on an object that is not extensible throws a TypeError.
321
342
  */
322
343
  fun put(key: String, value: Any?) {
323
- val slot = slots[key]
344
+ val slot = slots?.get(key)
324
345
  if (slot != null) {
325
346
  if (slot.isAccessor) {
326
347
  val setter = slot.set ?: throw JSException(JSTypeError("Cannot set property $key of #<Object> which has only a getter"))
@@ -350,7 +371,7 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
350
371
  /** `Object.defineProperty(object, key, descriptor)`; attributes the descriptor leaves out are false for a new property. */
351
372
  fun defineProperty(key: String, d: JSPropertyDescriptor) {
352
373
  val exists = storage.containsKey(key)
353
- val slot = slots[key] ?: JSPropertySlot(enumerable = exists, writable = exists, configurable = exists)
374
+ val slot = slots?.get(key) ?: JSPropertySlot(enumerable = exists, writable = exists, configurable = exists)
354
375
  if (!exists && !extensible) throw JSException(JSTypeError("Cannot define property $key, object is not extensible"))
355
376
  if (exists && !slot.configurable) {
356
377
  val changes = d.get != null || d.set != null || d.configurable == true || (d.enumerable != null && d.enumerable != slot.enumerable) ||
@@ -366,14 +387,14 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
366
387
  d.writable?.let { slot.writable = it }
367
388
  d.configurable?.let { slot.configurable = it }
368
389
  define(key, if (slot.isAccessor) null else if (d.hasValue) d.value else storage[key])
369
- if (slot.isPlain) slots.remove(key) else slots[key] = slot
390
+ if (slot.isPlain) slots?.remove(key) else (slots ?: HashMap<String, JSPropertySlot>(4).also { slots = it })[key] = slot
370
391
  jsTracker?.trigger()
371
392
  }
372
393
 
373
394
  /** `Object.getOwnPropertyDescriptor(object, key)`. */
374
395
  fun descriptor(key: String): JSObject? {
375
396
  if (!storage.containsKey(key)) return null
376
- val slot = slots[key] ?: JSPropertySlot()
397
+ val slot = slots?.get(key) ?: JSPropertySlot()
377
398
  if (slot.isAccessor) {
378
399
  val g = slot.get
379
400
  val s = slot.set
@@ -388,39 +409,60 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
388
409
  fun restrict(sealed: Boolean, frozen: Boolean) {
389
410
  extensible = false
390
411
  if (!sealed && !frozen) return
391
- for (key in indexKeys.map { it.toString() } + namedKeys) {
392
- val slot = slots[key] ?: JSPropertySlot()
412
+ val s = slots ?: HashMap<String, JSPropertySlot>(storage.size).also { slots = it }
413
+ val idx = indexKeys
414
+ if (idx != null) {
415
+ for (n in idx) {
416
+ val key = n.toString()
417
+ val slot = s[key] ?: JSPropertySlot()
418
+ slot.configurable = false
419
+ if (frozen && !slot.isAccessor) slot.writable = false
420
+ s[key] = slot
421
+ }
422
+ }
423
+ for (key in namedKeys) {
424
+ val slot = s[key] ?: JSPropertySlot()
393
425
  slot.configurable = false
394
426
  if (frozen && !slot.isAccessor) slot.writable = false
395
- slots[key] = slot
427
+ s[key] = slot
396
428
  }
397
429
  }
398
430
 
399
- val isSealed: Boolean get() = !extensible && storage.keys.all { !(slots[it] ?: JSPropertySlot()).configurable }
400
- val isFrozen: Boolean get() = !extensible && storage.keys.all { val s = slots[it] ?: JSPropertySlot(); !s.configurable && (s.isAccessor || !s.writable) }
431
+ val isSealed: Boolean get() = !extensible && storage.keys.all { !(slots?.get(it) ?: JSPropertySlot()).configurable }
432
+ val isFrozen: Boolean get() = !extensible && storage.keys.all { val s = slots?.get(it) ?: JSPropertySlot(); !s.configurable && (s.isAccessor || !s.writable) }
401
433
 
402
434
  override fun jsAccessorKind(key: String): String? {
403
- val slot = slots[key] ?: return null
435
+ val slot = slots?.get(key) ?: return null
404
436
  if (!slot.isAccessor) return null
405
437
  return if (slot.get != null && slot.set != null) "Getter/Setter" else if (slot.get != null) "Getter" else "Setter"
406
438
  }
407
439
 
408
440
  /** `Object.getOwnPropertyNames(object)`: string keys, enumerable or not. */
409
- val ownPropertyNames: List<String> get() = indexKeys.map { it.toString() } + namedKeys.filter { !jsIsSymbolKey(it) }
441
+ val ownPropertyNames: List<String>
442
+ get() {
443
+ val idx = indexKeys
444
+ if (idx == null && !hasSymbols) return namedKeys
445
+ val names = if (hasSymbols) namedKeys.filter { !jsIsSymbolKey(it) } else namedKeys
446
+ return if (idx == null || idx.isEmpty()) names else idx.map { it.toString() } + names
447
+ }
410
448
 
411
449
  private fun define(key: String, value: Any?) {
412
450
  if (storage.containsKey(key)) { storage[key] = value; return }
413
451
  storage[key] = value
414
452
  val index = jsArrayIndex(key)
415
453
  if (index != null) {
454
+ val idx = indexKeys ?: ArrayList<Long>(4).also { indexKeys = it }
416
455
  var low = 0
417
- var high = indexKeys.size
456
+ var high = idx.size
418
457
  while (low < high) {
419
458
  val mid = (low + high) / 2
420
- if (indexKeys[mid] < index) low = mid + 1 else high = mid
459
+ if (idx[mid] < index) low = mid + 1 else high = mid
421
460
  }
422
- indexKeys.add(low, index)
423
- } else namedKeys.add(key)
461
+ idx.add(low, index)
462
+ } else {
463
+ if (jsIsSymbolKey(key)) hasSymbols = true
464
+ namedKeys.add(key)
465
+ }
424
466
  }
425
467
 
426
468
  /** `key in object` for own keys. */
@@ -431,12 +473,12 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
431
473
 
432
474
  /** `delete object[key]`. */
433
475
  fun delete(key: String): Boolean {
434
- slots[key]?.let { if (!it.configurable) return false }
435
- slots.remove(key)
476
+ slots?.get(key)?.let { if (!it.configurable) return false }
477
+ slots?.remove(key)
436
478
  if (!storage.containsKey(key)) return true
437
479
  storage.remove(key)
438
480
  val index = jsArrayIndex(key)
439
- if (index != null) indexKeys.remove(index) else namedKeys.remove(key)
481
+ if (index != null) indexKeys?.remove(index) else namedKeys.remove(key)
440
482
  jsTracker?.trigger()
441
483
  return true
442
484
  }
@@ -444,14 +486,18 @@ class JSObject() : JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConverti
444
486
  val keys: List<String>
445
487
  get() {
446
488
  jsTracker?.track()
447
- val all = indexKeys.map { it.toString() } + namedKeys.filter { !jsIsSymbolKey(it) }
448
- return if (slots.isEmpty()) all else all.filter { slots[it]?.enumerable ?: true }
489
+ val idx = indexKeys
490
+ val s = slots
491
+ if ((idx == null || idx.isEmpty()) && !hasSymbols && (s == null || s.isEmpty())) return namedKeys
492
+ val names = if (hasSymbols) namedKeys.filter { !jsIsSymbolKey(it) } else namedKeys
493
+ val all = if (idx == null || idx.isEmpty()) names else idx.map { it.toString() } + names
494
+ return if (s == null || s.isEmpty()) all else all.filter { s[it]?.enumerable ?: true }
449
495
  }
450
496
 
451
497
  override val jsSymbolKeys: List<String>
452
498
  get() {
453
499
  jsTracker?.track()
454
- return namedKeys.filter { jsIsSymbolKey(it) }
500
+ return if (!hasSymbols) emptyList() else namedKeys.filter { jsIsSymbolKey(it) }
455
501
  }
456
502
 
457
503
  override fun jsGet(key: String): Any? = this[key]
@@ -542,6 +588,69 @@ fun jsSet(target: Any?, key: String, value: Any?) {
542
588
  }
543
589
  }
544
590
 
591
+ internal val JS_EMPTY_ARGS: Array<Any?> = emptyArray()
592
+
593
+ /** Zero-vararg exact-arity fast paths for `jsCall` (0–3 arguments), avoiding `Object[]` allocation per call. */
594
+ @Suppress("UNCHECKED_CAST")
595
+ fun jsCall(function: Any?): Any? {
596
+ val result = when (function) {
597
+ is Function0<*> -> (function as () -> Any?)()
598
+ is Function1<*, *> -> (function as (Any?) -> Any?)(null)
599
+ is Function2<*, *, *> -> (function as (Any?, Any?) -> Any?)(null, null)
600
+ is Function3<*, *, *, *> -> (function as (Any?, Any?, Any?) -> Any?)(null, null, null)
601
+ is JSFunction -> function.body(emptyList())
602
+ is JSMethod -> function.call(null, JS_EMPTY_ARGS)
603
+ is JavaMethodRef -> function.call(emptyList())
604
+ else -> return jsCall(function, *JS_EMPTY_ARGS)
605
+ }
606
+ return jsBox(result)
607
+ }
608
+
609
+ @Suppress("UNCHECKED_CAST")
610
+ fun jsCall(function: Any?, a0: Any?): Any? {
611
+ val result = when (function) {
612
+ is Function0<*> -> (function as () -> Any?)()
613
+ is Function1<*, *> -> (function as (Any?) -> Any?)(a0)
614
+ is Function2<*, *, *> -> (function as (Any?, Any?) -> Any?)(a0, null)
615
+ is Function3<*, *, *, *> -> (function as (Any?, Any?, Any?) -> Any?)(a0, null, null)
616
+ is JSFunction -> function.body(listOf(a0))
617
+ is JSMethod -> function.call(null, arrayOf(a0))
618
+ is JavaMethodRef -> function.call(listOf(a0))
619
+ else -> return jsCall(function, *arrayOf(a0))
620
+ }
621
+ return jsBox(result)
622
+ }
623
+
624
+ @Suppress("UNCHECKED_CAST")
625
+ fun jsCall(function: Any?, a0: Any?, a1: Any?): Any? {
626
+ val result = when (function) {
627
+ is Function0<*> -> (function as () -> Any?)()
628
+ is Function1<*, *> -> (function as (Any?) -> Any?)(a0)
629
+ is Function2<*, *, *> -> (function as (Any?, Any?) -> Any?)(a0, a1)
630
+ is Function3<*, *, *, *> -> (function as (Any?, Any?, Any?) -> Any?)(a0, a1, null)
631
+ is JSFunction -> function.body(listOf(a0, a1))
632
+ is JSMethod -> function.call(null, arrayOf(a0, a1))
633
+ is JavaMethodRef -> function.call(listOf(a0, a1))
634
+ else -> return jsCall(function, *arrayOf(a0, a1))
635
+ }
636
+ return jsBox(result)
637
+ }
638
+
639
+ @Suppress("UNCHECKED_CAST")
640
+ fun jsCall(function: Any?, a0: Any?, a1: Any?, a2: Any?): Any? {
641
+ val result = when (function) {
642
+ is Function0<*> -> (function as () -> Any?)()
643
+ is Function1<*, *> -> (function as (Any?) -> Any?)(a0)
644
+ is Function2<*, *, *> -> (function as (Any?, Any?) -> Any?)(a0, a1)
645
+ is Function3<*, *, *, *> -> (function as (Any?, Any?, Any?) -> Any?)(a0, a1, a2)
646
+ is JSFunction -> function.body(listOf(a0, a1, a2))
647
+ is JSMethod -> function.call(null, arrayOf(a0, a1, a2))
648
+ is JavaMethodRef -> function.call(listOf(a0, a1, a2))
649
+ else -> return jsCall(function, *arrayOf(a0, a1, a2))
650
+ }
651
+ return jsBox(result)
652
+ }
653
+
545
654
  /** Calls a function stored in a dynamic value with JavaScript's argument rules. Anything else throws a TypeError. */
546
655
  @Suppress("UNCHECKED_CAST")
547
656
  fun jsCall(function: Any?, vararg args: Any?): Any? {
@@ -599,8 +599,24 @@ open class ColorBase: JSDynamic, JSStringConvertible, JSExpando, JSKeysMade, JSS
599
599
  open subscript(jsKey key: String) -> Any? {
600
600
  get {
601
601
  switch key.utf8.count {
602
+ case 1:
603
+ switch key {
604
+ case "a": return self.a
605
+ case "r": return self.r
606
+ case "g": return self.g
607
+ case "b": return self.b
608
+ default: break
609
+ }
610
+ case 3:
611
+ switch key {
612
+ case "hex": return self.hex
613
+ case "ios": return self.ios
614
+ default: break
615
+ }
602
616
  case 4:
603
617
  switch key {
618
+ case "argb": return self.argb
619
+ case "name": return self.name
604
620
  case "spin": return FunctionCell_Double_to_ColorBaseOpt.script("spin", 1, self.spin)
605
621
  default: break
606
622
  }
@@ -625,6 +641,7 @@ open class ColorBase: JSDynamic, JSStringConvertible, JSExpando, JSKeysMade, JSS
625
641
  }
626
642
  case 7:
627
643
  switch key {
644
+ case "android": return self.android
628
645
  case "isLight": return FunctionCell_none_to_Bool.script("isLight", 0, self.isLight)
629
646
  case "lighten": return FunctionCell_Double_to_ColorBaseOpt.script("lighten", 1, self.lighten)
630
647
  default: break
@@ -59,11 +59,71 @@ open class Color: ColorBase {
59
59
  open override subscript(jsKey key: String) -> Any? {
60
60
  get {
61
61
  switch key.utf8.count {
62
+ case 3:
63
+ switch key {
64
+ case "ios": return self.ios
65
+ default: break
66
+ }
62
67
  case 4:
63
68
  switch key {
64
69
  case "_ios":
65
70
  if !(jsMadeBits0 & (1 << 2) != 0) { return nil }
66
71
  return self._ios
72
+ case "spin": return FunctionCell_Double_to_ColorBaseOpt.script("spin", 1, self.spin)
73
+ default: break
74
+ }
75
+ case 5:
76
+ switch key {
77
+ case "toHsl": return FunctionCell_none_to_Object_a_h_s_lOpt.script("toHsl", 0, self.toHsl)
78
+ case "toHsv": return FunctionCell_none_to_Object_a_h_s_vOpt.script("toHsv", 0, self.toHsv)
79
+ default: break
80
+ }
81
+ case 6:
82
+ switch key {
83
+ case "equals": return FunctionCell_AnyOpt_to_Bool.script("equals", 1, self.equals)
84
+ case "isDark": return FunctionCell_none_to_Bool.script("isDark", 0, self.isDark)
85
+ case "darken": return FunctionCell_Double_to_ColorBaseOpt.script("darken", 1, self.darken)
86
+ default: break
87
+ }
88
+ case 7:
89
+ switch key {
90
+ case "isLight": return FunctionCell_none_to_Bool.script("isLight", 0, self.isLight)
91
+ case "lighten": return FunctionCell_Double_to_ColorBaseOpt.script("lighten", 1, self.lighten)
92
+ default: break
93
+ }
94
+ case 8:
95
+ switch key {
96
+ case "setAlpha": return FunctionCell_Double_to_ColorBaseOpt.script("setAlpha", 1, self.setAlpha)
97
+ case "saturate": return FunctionCell_Double_to_ColorBaseOpt.script("saturate", 1, self.saturate)
98
+ case "brighten": return FunctionCell_Double_to_ColorBaseOpt.script("brighten", 1, self.brighten)
99
+ default: break
100
+ }
101
+ case 9:
102
+ switch key {
103
+ case "greyscale": return FunctionCell_none_to_ColorBaseOpt.script("greyscale", 0, self.greyscale)
104
+ default: break
105
+ }
106
+ case 10:
107
+ switch key {
108
+ case "desaturate": return FunctionCell_Double_to_ColorBaseOpt.script("desaturate", 1, self.desaturate)
109
+ case "complement": return FunctionCell_none_to_ColorBaseOpt.script("complement", 0, self.complement)
110
+ default: break
111
+ }
112
+ case 11:
113
+ switch key {
114
+ case "toHslString": return FunctionCell_none_to_String.script("toHslString", 0, self.toHslString)
115
+ case "toHsvString": return FunctionCell_none_to_String.script("toHsvString", 0, self.toHsvString)
116
+ case "toRgbString": return FunctionCell_none_to_String.script("toRgbString", 0, self.toRgbString)
117
+ default: break
118
+ }
119
+ case 12:
120
+ switch key {
121
+ case "getLuminance": return FunctionCell_none_to_Double.script("getLuminance", 0, self.getLuminance)
122
+ default: break
123
+ }
124
+ case 13:
125
+ switch key {
126
+ case "getBrightness": return FunctionCell_none_to_Double.script("getBrightness", 0, self.getBrightness)
67
127
  default: break
68
128
  }
69
129
  default: break
@@ -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)
@@ -1683,7 +1683,7 @@
1683
1683
  "jsStaticKeys": [{"kind":"var","static":true,"type":"[String]"}],
1684
1684
  "subscript": [{"kind":"subscript","type":"Any?","params":[{"label":"jsKey","name":"key","type":"String"}]}]
1685
1685
  },
1686
- "names": ["_ios"],
1686
+ "names": ["_ios","brighten","complement","darken","desaturate","equals","getBrightness","getLuminance","greyscale","ios","isDark","isLight","lighten","saturate","setAlpha","spin","toHsl","toHslString","toHsv","toHsvString","toRgbString"],
1687
1687
  "base": "ColorBase"
1688
1688
  },
1689
1689
  "ColorBase": {
@@ -1741,7 +1741,7 @@
1741
1741
  "toRgbString": [{"kind":"func","type":"String","params":[]}],
1742
1742
  "toString": [{"kind":"func","type":"String","params":[]}]
1743
1743
  },
1744
- "names": ["_argb","_argbFromString","_name","brighten","complement","darken","desaturate","equals","getBrightness","getLuminance","greyscale","isDark","isLight","lighten","saturate","setAlpha","spin","toHsl","toHslString","toHsv","toHsvString","toRgbString","toString"]
1744
+ "names": ["_argb","_argbFromString","_name","a","android","argb","b","brighten","complement","darken","desaturate","equals","g","getBrightness","getLuminance","greyscale","hex","ios","isDark","isLight","lighten","name","r","saturate","setAlpha","spin","toHsl","toHslString","toHsv","toHsvString","toRgbString","toString"]
1745
1745
  },
1746
1746
  "Combinator": {
1747
1747
  "kind": "enum",
@@ -13809,7 +13809,7 @@
13809
13809
  "target": [{"kind":"var","type":"View?"}],
13810
13810
  "type": [{"kind":"var","type":"Double"}]
13811
13811
  },
13812
- "names": ["_callback","_context","_target","disconnect","type"]
13812
+ "names": ["_callback","_context","_target","callback","context","disconnect","type"]
13813
13813
  },
13814
13814
  "GridLayout": {
13815
13815
  "kind": "class",
@@ -99,11 +99,13 @@ open class GesturesObserverBase: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed
99
99
  case 7:
100
100
  switch key {
101
101
  case "_target": return self._target
102
+ case "context": return self.context
102
103
  default: break
103
104
  }
104
105
  case 8:
105
106
  switch key {
106
107
  case "_context": return self._context
108
+ case "callback": return FunctionCell_AnyOpt_to_Void.scriptOrNil("", 1, self.callback)
107
109
  default: break
108
110
  }
109
111
  case 9: