@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.
- package/README.md +3 -0
- package/dist/kit/kit-index.js +9 -0
- package/dist/kotlin/access.js +14 -15
- package/dist/kotlin/arguments.js +2 -2
- package/dist/kotlin/assignment.js +22 -13
- package/dist/kotlin/builtins.js +67 -0
- package/dist/kotlin/calls.js +3 -2
- package/dist/kotlin/class-declaration.js +16 -1
- package/dist/kotlin/class-methods.js +2 -2
- package/dist/kotlin/components.js +2 -7
- package/dist/kotlin/core-api.js +3 -22
- package/dist/kotlin/declarations.js +86 -9
- package/dist/kotlin/expression-statements.js +13 -1
- package/dist/kotlin/functions.js +2 -4
- package/dist/kotlin/global-calls.js +1 -4
- package/dist/kotlin/literals.js +3 -10
- package/dist/kotlin/names.js +6 -4
- package/dist/kotlin/native/api.js +1 -1
- package/dist/kotlin/native/classfiles.js +2 -13
- package/dist/kotlin/operators.js +36 -30
- package/dist/kotlin/optional-chains.js +3 -10
- package/dist/kotlin/overrides.js +5 -17
- package/dist/kotlin/placement.js +1 -12
- package/dist/kotlin/state-backend.js +6 -2
- package/dist/kotlin/statements.js +1 -13
- package/dist/kotlin/translator.js +3 -11
- package/dist/kotlin/type-tests.js +1 -1
- package/dist/kotlin/types.js +6 -23
- package/dist/program/core-facts.js +9 -0
- package/dist/semantics/classes.js +15 -0
- package/dist/semantics/facts.js +38 -2
- package/dist/semantics/lang.js +29 -0
- package/dist/semantics/lower.js +144 -0
- package/dist/semantics/lowering-methods.js +120 -3
- package/dist/semantics/marks.js +30 -0
- package/dist/semantics/placement.js +9 -3
- package/dist/semantics/refusals.js +12 -11
- package/dist/semantics/signals.js +11 -0
- package/dist/semantics/states/missing.js +7 -0
- package/dist/semantics/tdz.js +142 -8
- package/dist/semantics/throws.js +1 -1
- package/dist/semantics/translator-methods.js +1 -1
- package/dist/swift/access.js +13 -17
- package/dist/swift/assignment.js +30 -16
- package/dist/swift/calls.js +13 -5
- package/dist/swift/classes.js +22 -10
- package/dist/swift/components.js +3 -7
- package/dist/swift/control-flow.js +1 -1
- package/dist/swift/conversion.js +5 -2
- package/dist/swift/core-api.js +11 -31
- package/dist/swift/declarations.js +1 -6
- package/dist/swift/expression-statements.js +7 -0
- package/dist/swift/expressions.js +6 -2
- package/dist/swift/from-any.js +1 -1
- package/dist/swift/functions.js +5 -6
- package/dist/swift/global-calls.js +1 -5
- package/dist/swift/lenient.js +0 -7
- package/dist/swift/literals.js +8 -3
- package/dist/swift/method-values.js +1 -19
- package/dist/swift/modules.js +5 -3
- package/dist/swift/names.js +3 -12
- package/dist/swift/native/api.js +3 -1
- package/dist/swift/native/calls.js +1 -1
- package/dist/swift/native/dispatch.js +2 -8
- package/dist/swift/object-classes.js +84 -1
- package/dist/swift/operators.js +37 -34
- package/dist/swift/optional-chains.js +1 -8
- package/dist/swift/parameters.js +0 -4
- package/dist/swift/placement.js +5 -15
- package/dist/swift/results.js +0 -4
- package/dist/swift/state-backend.js +3 -2
- package/dist/swift/statements.js +1 -13
- package/dist/swift/static-calls.js +2 -3
- package/dist/swift/syntax.js +9 -5
- package/dist/swift/translator.js +1 -11
- package/dist/swift/type-facts.js +3 -3
- package/dist/swift/types.js +3 -3
- package/dist/targets/ios/build.js +1 -1
- package/dist/types/adapter-api.d.ts +3 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/__Modules.kt +1 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +525 -99
- package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_common.kt +2 -2
- package/kit-android/generated/kotlin/org/nativescript/kit/application_application_common.kt +29 -6
- package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers_common.kt +14 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/color_color_utils.kt +3 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/css_mediaquery_index.kt +49 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_array_index.kt +0 -8
- package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_index.kt +0 -16
- package/kit-android/generated/kotlin/org/nativescript/kit/data_virtual_array_index.kt +6 -4
- package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_index.kt +19 -7
- package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_http_request_internal_common.kt +14 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_index.kt +19 -10
- package/kit-android/generated/kotlin/org/nativescript/kit/matrix_index.kt +17 -29
- package/kit-android/generated/kotlin/org/nativescript/kit/media_query_list_index.kt +144 -22
- package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_parse.kt +8 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptLifecycleCallbacks.kt +2 -10
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_index.kt +0 -2
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_expression_parser.kt +6 -10
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_index.kt +531 -8
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +0 -9
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_weak_event_listener_index.kt +3 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_index.kt +19 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_properties.kt +5 -2
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_scope.kt +232 -174
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_text_view_common.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/utils_android_runtime_version.kt +75 -0
- package/kit-android/generated/manifest.json +21 -18
- package/kit-android/generated/source-lines.json +1 -1
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Array.kt +547 -51
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Intl.kt +1 -1
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/JSON.kt +52 -6
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Language.kt +33 -0
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Prototypes.kt +9 -1
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Strings.kt +32 -18
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Values.kt +137 -28
- package/kit-apple/Overlays/xml-free/Core/ui.builder.index.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +14 -10
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +3 -9
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +20 -21
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +5 -7
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android_.swift +130 -0
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +2 -4
- package/kit-apple/Sources/NativeScriptKit/Core/Object_specified_substituted_reads.swift +115 -0
- package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads.swift +113 -0
- package/kit-apple/Sources/NativeScriptKit/Core/Object_substituted_values_reads_.swift +113 -0
- package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +348 -330
- package/kit-apple/Sources/NativeScriptKit/Core/application.application.ios.swift +358 -359
- package/kit-apple/Sources/NativeScriptKit/Core/application.helpers-common.swift +47 -29
- package/kit-apple/Sources/NativeScriptKit/Core/connectivity.index.ios.swift +3 -1
- package/kit-apple/Sources/NativeScriptKit/Core/css-mediaquery.index.swift +95 -53
- package/kit-apple/Sources/NativeScriptKit/Core/css.CSS3Parser.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/css.parser.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/data.observable-array.index.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +52 -43
- package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.http-request-internal-common.swift +18 -0
- package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +66 -51
- package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +67 -51
- package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +24 -6
- package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +143 -32
- package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +30 -19
- package/kit-apple/Sources/NativeScriptKit/Core/media-query-list.index.swift +190 -78
- package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.parse.swift +205 -201
- package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.stringify.swift +41 -42
- package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.types.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/trace.index.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.index.ios.swift +77 -65
- package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +1272 -824
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.index.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +8 -8
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-common.swift +2 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +6 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +22 -21
- package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +202 -188
- package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +2 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.clip-path-function.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-animation-parser.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-selector.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-common.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-scope.swift +869 -838
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style.index.swift +46 -31
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +1 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.modal-transition.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.page-transition.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition-helper.ios.swift +17 -17
- package/kit-apple/Sources/NativeScriptKit/Core/utils.android-runtime-version.swift +77 -0
- package/kit-apple/Sources/NativeScriptKit/Core/utils.debug-source.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/xhr.index.swift +62 -61
- package/kit-apple/Sources/NativeScriptKit/Runtime/Array.swift +4 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Dynamic.swift +2 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Interop.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/Intl.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/Iterators.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/JSON.swift +413 -73
- package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +3 -2
- package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +14 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/Symbol.swift +1 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Values.swift +1 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Views.swift +2 -0
- package/package.json +2 -2
|
@@ -765,6 +765,19 @@ open class Style : Observable, JSStringConvertible {
|
|
|
765
765
|
jsMadeNote1(1L shl 58, "_localValueVersion")
|
|
766
766
|
}
|
|
767
767
|
|
|
768
|
+
/**
|
|
769
|
+
* Local values specified with var()/calc(), by css name, with the variables their last
|
|
770
|
+
* substitution read and what it produced. The cascade substitutes them again when those
|
|
771
|
+
* variables change.
|
|
772
|
+
*/
|
|
773
|
+
@get:JvmName("__get__localCssExpressions")
|
|
774
|
+
@set:JvmName("__set__localCssExpressions")
|
|
775
|
+
var _localCssExpressions: JSMap<String, Any?>? = null
|
|
776
|
+
set(value) {
|
|
777
|
+
field = value
|
|
778
|
+
jsMadeNote1(1L shl 59, "_localCssExpressions")
|
|
779
|
+
}
|
|
780
|
+
|
|
768
781
|
constructor(ownerView: Any?) : super() {
|
|
769
782
|
if (
|
|
770
783
|
jsIndexOf(
|
|
@@ -1000,6 +1013,8 @@ open class Style : Observable, JSStringConvertible {
|
|
|
1000
1013
|
(if ((jsMadeBits1 and (1L shl 56)) != 0L) listOf("PropertyBag") else listOf()) +
|
|
1001
1014
|
(if ((jsMadeBits1 and (1L shl 57)) != 0L) listOf("viewRef") else listOf()) +
|
|
1002
1015
|
(if ((jsMadeBits1 and (1L shl 58)) != 0L) listOf("_localValueVersion")
|
|
1016
|
+
else listOf()) +
|
|
1017
|
+
(if ((jsMadeBits1 and (1L shl 59)) != 0L) listOf("_localCssExpressions")
|
|
1003
1018
|
else listOf())
|
|
1004
1019
|
|
|
1005
1020
|
override val jsClassName: String?
|
|
@@ -1132,6 +1147,8 @@ open class Style : Observable, JSStringConvertible {
|
|
|
1132
1147
|
"PropertyBag" -> this.PropertyBag
|
|
1133
1148
|
"viewRef" -> if ((jsMadeBits1 and (1L shl 57)) != 0L) this.viewRef else null
|
|
1134
1149
|
"_localValueVersion" -> this._localValueVersion
|
|
1150
|
+
"_localCssExpressions" ->
|
|
1151
|
+
if ((jsMadeBits1 and (1L shl 59)) != 0L) this._localCssExpressions else null
|
|
1135
1152
|
"view" -> this.view
|
|
1136
1153
|
"setScopedCssVariable" ->
|
|
1137
1154
|
jsFunction { __a ->
|
|
@@ -1309,6 +1326,8 @@ open class Style : Observable, JSStringConvertible {
|
|
|
1309
1326
|
"viewRef" -> this.viewRef = jsAs<JSWeakRef<ViewBase>?>(jsJavaArgument(value))
|
|
1310
1327
|
"_localValueVersion" ->
|
|
1311
1328
|
this._localValueVersion = jsConvertedNumberOrNull(value, "_localValueVersion")
|
|
1329
|
+
"_localCssExpressions" ->
|
|
1330
|
+
this._localCssExpressions = jsAs<JSMap<String, Any?>?>(jsJavaArgument(value))
|
|
1312
1331
|
else -> super.jsSet(key, value)
|
|
1313
1332
|
}
|
|
1314
1333
|
}
|
|
@@ -1959,7 +1959,8 @@ object Core_ui_styling_style_properties {
|
|
|
1959
1959
|
?: jsCannotRead("get"))
|
|
1960
1960
|
.get()
|
|
1961
1961
|
if (jsTruthy(view)) {
|
|
1962
|
-
(view
|
|
1962
|
+
(view
|
|
1963
|
+
?: jsCannotSet("effectiveBorderBottomWidth"))
|
|
1963
1964
|
.effectiveBorderBottomWidth = value
|
|
1964
1965
|
} else {
|
|
1965
1966
|
org.nativescript.kit.Trace.write(
|
|
@@ -2457,7 +2458,9 @@ object Core_ui_styling_style_properties {
|
|
|
2457
2458
|
},
|
|
2458
2459
|
)
|
|
2459
2460
|
)
|
|
2460
|
-
Core_ui_styling_style_properties.zIndexProperty.register(
|
|
2461
|
+
Core_ui_styling_style_properties.zIndexProperty.register(
|
|
2462
|
+
Style::class.java
|
|
2463
|
+
)
|
|
2461
2464
|
opacityProperty =
|
|
2462
2465
|
CssAnimationProperty(
|
|
2463
2466
|
jsObjectOf(
|
|
@@ -841,7 +841,7 @@ open class CssState : JSStringConvertible, JSExpando, JSKeysMade {
|
|
|
841
841
|
continue
|
|
842
842
|
}
|
|
843
843
|
val value: Any? =
|
|
844
|
-
|
|
844
|
+
Core_ui_core_properties_index._evaluateCssExpressions(
|
|
845
845
|
view,
|
|
846
846
|
property,
|
|
847
847
|
(cssExpsProperties ?: jsCannotRead(property))[property],
|
|
@@ -883,7 +883,12 @@ open class CssState : JSStringConvertible, JSExpando, JSKeysMade {
|
|
|
883
883
|
)
|
|
884
884
|
if (!jsTruthy(resolved)) {
|
|
885
885
|
resolved =
|
|
886
|
-
|
|
886
|
+
jsRecordOrNull<Any?>(
|
|
887
|
+
jsGet(
|
|
888
|
+
Core_ui_core_properties_index._substituteCssShorthand(view, pending),
|
|
889
|
+
"values",
|
|
890
|
+
)
|
|
891
|
+
)
|
|
887
892
|
(resolvedShorthands ?: jsCannotRead("set")).set(
|
|
888
893
|
jsUnchecked<CssPendingSubstitution>(pending),
|
|
889
894
|
jsUnchecked<JSRecord<Any?>>(resolved),
|
|
@@ -1013,6 +1018,14 @@ open class CssState : JSStringConvertible, JSExpando, JSKeysMade {
|
|
|
1013
1018
|
this._appliedLocalValueVersion =
|
|
1014
1019
|
(((view ?: jsCannotRead("style")).style ?: jsCannotRead("_localValueVersion"))
|
|
1015
1020
|
._localValueVersion ?: Double.NaN)
|
|
1021
|
+
if (
|
|
1022
|
+
jsTruthy(
|
|
1023
|
+
((view ?: jsCannotRead("style")).style ?: jsCannotRead("_localCssExpressions"))
|
|
1024
|
+
._localCssExpressions
|
|
1025
|
+
)
|
|
1026
|
+
) {
|
|
1027
|
+
Core_ui_core_properties_index._reevaluateLocalCssExpressions(view)
|
|
1028
|
+
}
|
|
1016
1029
|
}
|
|
1017
1030
|
|
|
1018
1031
|
open fun subscribeForDynamicUpdates() {
|
|
@@ -1839,7 +1852,12 @@ open class StyleScope : JSExpando, JSKeysMade {
|
|
|
1839
1852
|
@UiThread
|
|
1840
1853
|
object Core_ui_styling_style_scope {
|
|
1841
1854
|
init {
|
|
1842
|
-
jsLexical(
|
|
1855
|
+
jsLexical(
|
|
1856
|
+
"animationsSymbol",
|
|
1857
|
+
"animationVariablesSymbol",
|
|
1858
|
+
"keyframeVariablesSymbol",
|
|
1859
|
+
"inlineStyleProperties",
|
|
1860
|
+
)
|
|
1843
1861
|
}
|
|
1844
1862
|
|
|
1845
1863
|
@JvmField var parser: String = "css-tree"
|
|
@@ -1946,80 +1964,9 @@ object Core_ui_styling_style_scope {
|
|
|
1946
1964
|
}
|
|
1947
1965
|
@JvmField var pattern: JSRegExp? = null
|
|
1948
1966
|
|
|
1949
|
-
/**
|
|
1950
|
-
* Parse a pending-substitution shorthand once its expression has been evaluated against the
|
|
1951
|
-
* view; a value that does not survive evaluation leaves its longhands unset.
|
|
1952
|
-
*/
|
|
1953
|
-
fun resolvePendingSubstitution(
|
|
1954
|
-
view: ViewBase?,
|
|
1955
|
-
pending: CssPendingSubstitution?,
|
|
1956
|
-
): JSRecord<Any?>? {
|
|
1957
|
-
val value: Any? =
|
|
1958
|
-
Core_ui_styling_style_scope.evaluateCssExpressions(
|
|
1959
|
-
view,
|
|
1960
|
-
(pending ?: jsCannotRead("shorthand")).shorthand,
|
|
1961
|
-
(pending ?: jsCannotRead("value")).value,
|
|
1962
|
-
)
|
|
1963
|
-
if (
|
|
1964
|
-
jsStrictEquals(value, Core_ui_core_properties_property_shared.unsetValue)
|
|
1965
|
-
) {
|
|
1966
|
-
return CssState.emptyPropertyBag
|
|
1967
|
-
}
|
|
1968
|
-
val expanded: JSArray<Pair<String, Any?>>? =
|
|
1969
|
-
Core_ui_core_properties_index._expandCssShorthand(
|
|
1970
|
-
(pending ?: jsCannotRead("shorthand")).shorthand,
|
|
1971
|
-
jsConvertedStringOrNull(value),
|
|
1972
|
-
)
|
|
1973
|
-
if (!jsTruthy(expanded)) {
|
|
1974
|
-
org.nativescript.kit.Trace.write(
|
|
1975
|
-
"Failed to expand shorthand [${jsToString(((pending ?: jsCannotRead("shorthand")).shorthand ?: "undefined"))}] resolved to [${jsToStringThrowing(value)}] for ${jsToStringThrowing(view)}.",
|
|
1976
|
-
org.nativescript.kit.Trace.categories.Style,
|
|
1977
|
-
org.nativescript.kit.Trace.messageType.warn,
|
|
1978
|
-
)
|
|
1979
|
-
return CssState.emptyPropertyBag
|
|
1980
|
-
}
|
|
1981
|
-
val resolved: JSRecord<Any?> =
|
|
1982
|
-
(jsAsOrNull<JSRecord<Any?>>(JSRecord<Any?>()) ?: JSRecord<Any?>())
|
|
1983
|
-
var i: Double = 0.0
|
|
1984
|
-
val length: Double = (expanded ?: jsCannotRead("length")).length
|
|
1985
|
-
while (i < length) {
|
|
1986
|
-
resolved[
|
|
1987
|
-
((expanded ?: jsCannotRead(js(i))).element(i) ?: jsCannotRead("0")).first] =
|
|
1988
|
-
((expanded ?: jsCannotRead(js(i))).element(i) ?: jsCannotRead("1")).second
|
|
1989
|
-
i += 1.0
|
|
1990
|
-
}
|
|
1991
|
-
return resolved
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
/** Evaluate css-variable and css-calc expressions */
|
|
1995
|
-
fun evaluateCssExpressions(view: ViewBase?, property: String?, value: String?): Any? {
|
|
1996
|
-
var value = value
|
|
1997
|
-
val newValue: String =
|
|
1998
|
-
Core_ui_core_properties_index._evaluateCssVariableExpression(view, property, value)
|
|
1999
|
-
if (newValue == "unset") {
|
|
2000
|
-
return Core_ui_core_properties_property_shared.unsetValue
|
|
2001
|
-
}
|
|
2002
|
-
value = newValue
|
|
2003
|
-
try {
|
|
2004
|
-
value =
|
|
2005
|
-
jsConvertedStringOrNull(
|
|
2006
|
-
Core_ui_core_properties_index._evaluateCssCalcExpression(value)
|
|
2007
|
-
)
|
|
2008
|
-
} catch (__e_1: Throwable) {
|
|
2009
|
-
val e: Any? = jsCaught(__e_1)
|
|
2010
|
-
org.nativescript.kit.Trace.write(
|
|
2011
|
-
"Failed to evaluate css-calc for property [${jsToString((property ?: "undefined"))}] for expression [${jsToString((value ?: "undefined"))}] to ${jsToStringThrowing(view)}. ${jsToStringThrowing(jsGet(e, "stack"))}",
|
|
2012
|
-
org.nativescript.kit.Trace.categories.Error,
|
|
2013
|
-
org.nativescript.kit.Trace.messageType.error,
|
|
2014
|
-
)
|
|
2015
|
-
return Core_ui_core_properties_property_shared.unsetValue
|
|
2016
|
-
}
|
|
2017
|
-
return value
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
1967
|
fun evaluateCssVariable(view: ViewBase?, name: String?, value: String?): String? {
|
|
2021
1968
|
val evaluated: Any? =
|
|
2022
|
-
|
|
1969
|
+
Core_ui_core_properties_index._evaluateCssExpressions(view, name, value)
|
|
2023
1970
|
return (if (
|
|
2024
1971
|
jsStrictEquals(evaluated, Core_ui_core_properties_property_shared.unsetValue)
|
|
2025
1972
|
)
|
|
@@ -2341,6 +2288,18 @@ object Core_ui_styling_style_scope {
|
|
|
2341
2288
|
)
|
|
2342
2289
|
(keyframes ?: jsCannotRead("push")).push(keyframeRule)
|
|
2343
2290
|
} else if (Core_ui_styling_style_scope.isMedia(node)) {
|
|
2291
|
+
if (
|
|
2292
|
+
!Core_css_mediaquery_index.isEvaluableMediaQuery(
|
|
2293
|
+
jsConvertedStringOrNull(jsGet(node, "media"))
|
|
2294
|
+
)
|
|
2295
|
+
) {
|
|
2296
|
+
org.nativescript.kit.Trace.write(
|
|
2297
|
+
"Dropping '@media ${jsToStringThrowing(jsGet(node, "media"))}': the runtime cannot evaluate it",
|
|
2298
|
+
org.nativescript.kit.Trace.categories.MediaQuery,
|
|
2299
|
+
org.nativescript.kit.Trace.messageType.warn,
|
|
2300
|
+
)
|
|
2301
|
+
continue
|
|
2302
|
+
}
|
|
2344
2303
|
val compositeMediaQuery: Any?
|
|
2345
2304
|
if (jsTruthy(mediaQueryString)) {
|
|
2346
2305
|
if (jsTypeof(mediaQueryString) == "string") {
|
|
@@ -2679,6 +2638,45 @@ object Core_ui_styling_style_scope {
|
|
|
2679
2638
|
)
|
|
2680
2639
|
}
|
|
2681
2640
|
|
|
2641
|
+
@get:JvmName("__get_inlineStyleProperties")
|
|
2642
|
+
@set:JvmName("__set_inlineStyleProperties")
|
|
2643
|
+
lateinit var inlineStyleProperties: JSWeakMap<ViewBase, JSSet<String>>
|
|
2644
|
+
|
|
2645
|
+
fun setInlineValue(view: ViewBase?, property: String?, value: Any?) {
|
|
2646
|
+
if (
|
|
2647
|
+
jsHasKey((view ?: jsCannotRead("style")).style, jsToString((property ?: "undefined")))
|
|
2648
|
+
) {
|
|
2649
|
+
jsSet(
|
|
2650
|
+
((view ?: jsCannotRead("style")).style ?: jsObjectRequired()),
|
|
2651
|
+
jsToString((property ?: "undefined")),
|
|
2652
|
+
value,
|
|
2653
|
+
)
|
|
2654
|
+
} else {
|
|
2655
|
+
jsSet(
|
|
2656
|
+
(view ?: jsObjectRequired()),
|
|
2657
|
+
jsToString((property ?: "undefined")),
|
|
2658
|
+
value,
|
|
2659
|
+
)
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
fun unsetInlineValue(view: ViewBase?, property: String?) {
|
|
2664
|
+
try {
|
|
2665
|
+
Core_ui_styling_style_scope.setInlineValue(
|
|
2666
|
+
view,
|
|
2667
|
+
property,
|
|
2668
|
+
Core_ui_core_properties_property_shared.unsetValue,
|
|
2669
|
+
)
|
|
2670
|
+
} catch (__e_1: Throwable) {
|
|
2671
|
+
val e: Any? = jsCaught(__e_1)
|
|
2672
|
+
org.nativescript.kit.Trace.write(
|
|
2673
|
+
"Failed to unset property [${jsToString((property ?: "undefined"))}] on ${jsToStringThrowing(view)}. ${jsToStringThrowing(e)}",
|
|
2674
|
+
org.nativescript.kit.Trace.categories.Error,
|
|
2675
|
+
org.nativescript.kit.Trace.messageType.error,
|
|
2676
|
+
)
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2682
2680
|
@JvmField var applyInlineStyle: Any? = null
|
|
2683
2681
|
|
|
2684
2682
|
fun isCurrentDirectory(uriPart: String?): Boolean {
|
|
@@ -2889,6 +2887,7 @@ object Core_ui_styling_style_scope {
|
|
|
2889
2887
|
"_appliedAnimations",
|
|
2890
2888
|
CssState.emptyAnimationArray,
|
|
2891
2889
|
)
|
|
2890
|
+
inlineStyleProperties = JSWeakMap<ViewBase, JSSet<String>>()
|
|
2892
2891
|
applyInlineStyle =
|
|
2893
2892
|
Core_profiling_index.profile(
|
|
2894
2893
|
"applyInlineStyle",
|
|
@@ -2898,128 +2897,187 @@ object Core_ui_styling_style_scope {
|
|
|
2898
2897
|
val inlineRuleSet: JSArray<RuleSet>? =
|
|
2899
2898
|
(CSSSource.fromSource(localStyle) ?: jsCannotRead("selectors"))
|
|
2900
2899
|
.selectors
|
|
2900
|
+
val declarations: JSArray<Any?>? =
|
|
2901
|
+
((inlineRuleSet ?: jsCannotRead("0")).element(0.0)
|
|
2902
|
+
?: jsCannotRead("declarations"))
|
|
2903
|
+
.declarations
|
|
2901
2904
|
((view ?: jsCannotRead("style")).style
|
|
2902
2905
|
?: jsCannotRead("resetUnscopedCssVariables"))
|
|
2903
2906
|
.resetUnscopedCssVariables()
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2907
|
+
var declared: JSSet<String>? = null
|
|
2908
|
+
(declarations ?: jsCannotRead("forEach")).forEach({ d: Any? ->
|
|
2909
|
+
val property: String? =
|
|
2910
|
+
jsConvertedStringOrNull(jsGet(d, "property"))
|
|
2911
|
+
if (
|
|
2912
|
+
Core_ui_core_properties_index.isCssVariable(property)
|
|
2913
|
+
) {
|
|
2914
|
+
((view ?: jsCannotRead("style")).style
|
|
2915
|
+
?: jsCannotRead("setUnscopedCssVariable"))
|
|
2916
|
+
.setUnscopedCssVariable(
|
|
2917
|
+
property,
|
|
2918
|
+
jsConvertedStringOrNull(jsGet(d, "value")),
|
|
2919
|
+
)
|
|
2920
|
+
} else {
|
|
2921
|
+
if (!jsTruthy(declared)) {
|
|
2922
|
+
declared = JSSet<String>()
|
|
2923
|
+
}
|
|
2924
|
+
(declared ?: jsCannotRead("add")).add(
|
|
2925
|
+
(property ?: "undefined")
|
|
2926
|
+
)
|
|
2927
|
+
}
|
|
2928
|
+
})
|
|
2929
|
+
val previous: JSSet<String>? =
|
|
2930
|
+
Core_ui_styling_style_scope.inlineStyleProperties.get(
|
|
2931
|
+
(view ?: jsObjectRequired())
|
|
2932
|
+
)
|
|
2933
|
+
if (jsTruthy(previous)) {
|
|
2934
|
+
(previous ?: jsCannotRead("forEach")).forEach({
|
|
2935
|
+
property: Any?,
|
|
2936
|
+
_: String? ->
|
|
2910
2937
|
if (
|
|
2911
|
-
|
|
2938
|
+
!jsTruthy(declared?.has(jsConvertedStringOrEmpty(property)))
|
|
2912
2939
|
) {
|
|
2913
|
-
(
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
jsConvertedStringOrNull(jsGet(d, "value")),
|
|
2918
|
-
)
|
|
2940
|
+
Core_ui_styling_style_scope.unsetInlineValue(
|
|
2941
|
+
view,
|
|
2942
|
+
jsConvertedStringOrNull(property),
|
|
2943
|
+
)
|
|
2919
2944
|
}
|
|
2920
2945
|
})
|
|
2921
|
-
|
|
2922
|
-
|
|
2946
|
+
}
|
|
2947
|
+
if (jsTruthy(declared)) {
|
|
2948
|
+
Core_ui_styling_style_scope.inlineStyleProperties.set(
|
|
2949
|
+
jsUnchecked<ViewBase>(view),
|
|
2950
|
+
jsUnchecked<JSSet<String>>(declared),
|
|
2951
|
+
)
|
|
2952
|
+
} else if (jsTruthy(previous)) {
|
|
2953
|
+
Core_ui_styling_style_scope.inlineStyleProperties.delete(
|
|
2954
|
+
jsUnchecked<ViewBase>(view)
|
|
2955
|
+
)
|
|
2956
|
+
}
|
|
2957
|
+
var resolvedShorthands: JSMap<CssPendingSubstitution, Any?>? =
|
|
2923
2958
|
null
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2959
|
+
var applied: JSSet<String>? = null
|
|
2960
|
+
(declarations ?: jsCannotRead("forEach")).forEach(
|
|
2961
|
+
fn11@{ d: Any? ->
|
|
2962
|
+
val property: String? =
|
|
2963
|
+
jsConvertedStringOrNull(jsGet(d, "property"))
|
|
2964
|
+
try {
|
|
2965
|
+
if (
|
|
2966
|
+
Core_ui_core_properties_index.isCssVariable(property)
|
|
2967
|
+
) {
|
|
2968
|
+
return@fn11
|
|
2969
|
+
}
|
|
2970
|
+
if (
|
|
2971
|
+
Core_ui_core_properties_index._isCssPendingSubstitution(
|
|
2972
|
+
jsGet(d, "value")
|
|
2973
|
+
)
|
|
2974
|
+
) {
|
|
2975
|
+
if (!jsTruthy(resolvedShorthands)) {
|
|
2976
|
+
resolvedShorthands =
|
|
2977
|
+
JSMap<CssPendingSubstitution, Any?>()
|
|
2936
2978
|
}
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2979
|
+
var resolved: Any? =
|
|
2980
|
+
(resolvedShorthands ?: jsCannotRead("get")).get(
|
|
2981
|
+
jsUnchecked<CssPendingSubstitution>(
|
|
2982
|
+
jsCast(
|
|
2983
|
+
jsGet(d, "value"),
|
|
2984
|
+
CssPendingSubstitution::class.java,
|
|
2985
|
+
)
|
|
2986
|
+
)
|
|
2941
2987
|
)
|
|
2942
|
-
) {
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
var resolved: JSRecord<Any?>? =
|
|
2948
|
-
(resolvedShorthands ?: jsCannotRead("get")).get(
|
|
2949
|
-
jsUnchecked<CssPendingSubstitution>(
|
|
2988
|
+
if (!jsTruthy(resolved)) {
|
|
2989
|
+
resolved =
|
|
2990
|
+
Core_ui_core_properties_index
|
|
2991
|
+
._substituteCssShorthand(
|
|
2992
|
+
view,
|
|
2950
2993
|
jsCast(
|
|
2951
2994
|
jsGet(d, "value"),
|
|
2952
2995
|
CssPendingSubstitution::class.java,
|
|
2953
|
-
)
|
|
2954
|
-
)
|
|
2955
|
-
)
|
|
2956
|
-
if (!jsTruthy(resolved)) {
|
|
2957
|
-
resolved =
|
|
2958
|
-
Core_ui_styling_style_scope
|
|
2959
|
-
.resolvePendingSubstitution(
|
|
2960
|
-
view,
|
|
2961
|
-
jsCast(
|
|
2962
|
-
jsGet(d, "value"),
|
|
2963
|
-
CssPendingSubstitution::class.java,
|
|
2964
|
-
),
|
|
2965
|
-
)
|
|
2966
|
-
(resolvedShorthands
|
|
2967
|
-
?: jsCannotRead("set"))
|
|
2968
|
-
.set(
|
|
2969
|
-
jsUnchecked<CssPendingSubstitution>(
|
|
2970
|
-
jsCast(
|
|
2971
|
-
jsGet(d, "value"),
|
|
2972
|
-
CssPendingSubstitution::class.java,
|
|
2973
|
-
)
|
|
2974
2996
|
),
|
|
2975
|
-
jsUnchecked<JSRecord<Any?>>(resolved),
|
|
2976
2997
|
)
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
(
|
|
2980
|
-
(
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
value =
|
|
2988
|
-
Core_ui_styling_style_scope.evaluateCssExpressions(
|
|
2989
|
-
view,
|
|
2990
|
-
property,
|
|
2991
|
-
jsConvertedStringOrNull(jsGet(d, "value")),
|
|
2998
|
+
(resolvedShorthands
|
|
2999
|
+
?: jsCannotRead("set"))
|
|
3000
|
+
.set(
|
|
3001
|
+
jsUnchecked<CssPendingSubstitution>(
|
|
3002
|
+
jsCast(
|
|
3003
|
+
jsGet(d, "value"),
|
|
3004
|
+
CssPendingSubstitution::class.java,
|
|
3005
|
+
)
|
|
3006
|
+
),
|
|
3007
|
+
resolved,
|
|
2992
3008
|
)
|
|
2993
3009
|
}
|
|
2994
|
-
|
|
2995
|
-
|
|
3010
|
+
Core_ui_core_properties_index
|
|
3011
|
+
._setLocalCssShorthandValue(
|
|
2996
3012
|
(view ?: jsCannotRead("style")).style,
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
jsToString(property),
|
|
3004
|
-
value,
|
|
3013
|
+
property,
|
|
3014
|
+
jsCast(
|
|
3015
|
+
jsGet(d, "value"),
|
|
3016
|
+
CssPendingSubstitution::class.java,
|
|
3017
|
+
),
|
|
3018
|
+
resolved,
|
|
3005
3019
|
)
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3020
|
+
} else if (
|
|
3021
|
+
jsHasKey(
|
|
3022
|
+
(view ?: jsCannotRead("style")).style,
|
|
3023
|
+
jsToString(property),
|
|
3024
|
+
)
|
|
3025
|
+
) {
|
|
3026
|
+
jsSet(
|
|
3027
|
+
((view ?: jsCannotRead("style")).style
|
|
3028
|
+
?: jsObjectRequired()),
|
|
3029
|
+
jsToString(property),
|
|
3030
|
+
jsGet(d, "value"),
|
|
3031
|
+
)
|
|
3032
|
+
} else {
|
|
3033
|
+
jsSet(
|
|
3034
|
+
(view ?: jsObjectRequired()),
|
|
3035
|
+
jsToString(property),
|
|
3036
|
+
Core_ui_core_properties_index._evaluateCssExpressions(
|
|
3037
|
+
view,
|
|
3038
|
+
property,
|
|
3039
|
+
jsConvertedStringOrNull(jsGet(d, "value")),
|
|
3040
|
+
),
|
|
3019
3041
|
)
|
|
3020
3042
|
}
|
|
3043
|
+
if (!jsTruthy(applied)) {
|
|
3044
|
+
applied = JSSet<String>()
|
|
3045
|
+
}
|
|
3046
|
+
(applied ?: jsCannotRead("add")).add(
|
|
3047
|
+
(property ?: "undefined")
|
|
3048
|
+
)
|
|
3049
|
+
} catch (__e_2: Throwable) {
|
|
3050
|
+
val e: Any? = jsCaught(__e_2)
|
|
3051
|
+
org.nativescript.kit.Trace.write(
|
|
3052
|
+
"Failed to apply property [${jsToString(jsConvertedStringOrNull(jsGet(d, "property")))}] with value [${jsToStringThrowing(jsGet(d, "value"))}] to ${jsToStringThrowing(view)}. ${jsToStringThrowing(e)}",
|
|
3053
|
+
org.nativescript.kit.Trace.categories.Error,
|
|
3054
|
+
org.nativescript.kit.Trace.messageType.error,
|
|
3055
|
+
)
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
)
|
|
3059
|
+
declared?.forEach({ property: Any?, _: String? ->
|
|
3060
|
+
if (
|
|
3061
|
+
!jsTruthy(applied?.has(jsConvertedStringOrEmpty(property)))
|
|
3062
|
+
) {
|
|
3063
|
+
(declared ?: jsCannotRead("delete")).delete(
|
|
3064
|
+
jsConvertedStringOrEmpty(property)
|
|
3065
|
+
)
|
|
3066
|
+
if (
|
|
3067
|
+
jsTruthy(previous?.has(jsConvertedStringOrEmpty(property)))
|
|
3068
|
+
) {
|
|
3069
|
+
Core_ui_styling_style_scope.unsetInlineValue(
|
|
3070
|
+
view,
|
|
3071
|
+
jsConvertedStringOrNull(property),
|
|
3072
|
+
)
|
|
3021
3073
|
}
|
|
3074
|
+
}
|
|
3075
|
+
})
|
|
3076
|
+
if (declared?.size == 0.0) {
|
|
3077
|
+
Core_ui_styling_style_scope.inlineStyleProperties.delete(
|
|
3078
|
+
jsUnchecked<ViewBase>(view)
|
|
3022
3079
|
)
|
|
3080
|
+
}
|
|
3023
3081
|
(view ?: jsCannotRead("_onCssStateChange"))
|
|
3024
3082
|
._onCssStateChange()
|
|
3025
3083
|
},
|
|
@@ -128,7 +128,7 @@ object Core_ui_text_view_text_view_common {
|
|
|
128
128
|
Property(
|
|
129
129
|
jsObjectOf(
|
|
130
130
|
"name" to "iosWritingToolsAllowedInput",
|
|
131
|
-
"defaultValue" to
|
|
131
|
+
"defaultValue" to JSArray.doublesOf(WritingToolsAllowedInput.Default),
|
|
132
132
|
)
|
|
133
133
|
)
|
|
134
134
|
Core_ui_text_view_text_view_common.iosWritingToolsAllowedInputProperty
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Generated from @nativescript/core by tools/kit: edit core, not this file.
|
|
2
|
+
package org.nativescript.kit
|
|
3
|
+
|
|
4
|
+
import androidx.annotation.AnyThread
|
|
5
|
+
|
|
6
|
+
@AnyThread
|
|
7
|
+
object Core_utils_android_runtime_version {
|
|
8
|
+
@JvmField var semverPattern: JSRegExp? = null
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Whether a `major.minor.patch[-prerelease]` version string is at or above the given release.
|
|
12
|
+
* Prereleases of the release itself are lower than it, as in semver.
|
|
13
|
+
*
|
|
14
|
+
* @param version Version to test; anything that is not a parsable version string yields false.
|
|
15
|
+
* @returns True only for a parsable version at or above `major.minor.patch`.
|
|
16
|
+
*/
|
|
17
|
+
fun isVersionAtLeast(version: Any?, major: Double, minor: Double, patch: Double): Boolean {
|
|
18
|
+
if (jsTypeof(version) != "string") {
|
|
19
|
+
return false
|
|
20
|
+
}
|
|
21
|
+
val match: JSMatch? =
|
|
22
|
+
(Core_utils_android_runtime_version.semverPattern ?: jsCannotRead("exec")).exec(
|
|
23
|
+
jsConvertedStringOrEmpty(version)
|
|
24
|
+
)
|
|
25
|
+
if (!jsTruthy(match)) {
|
|
26
|
+
return false
|
|
27
|
+
}
|
|
28
|
+
val parts: JSArray<Double> =
|
|
29
|
+
JSArray.doublesOf(
|
|
30
|
+
jsNumberFromString(((match ?: jsCannotRead("1")).get(1.0) ?: "undefined")),
|
|
31
|
+
jsNumberFromString(((match ?: jsCannotRead("2")).get(2.0) ?: "undefined")),
|
|
32
|
+
jsNumberFromString(((match ?: jsCannotRead("3")).get(3.0) ?: "undefined")),
|
|
33
|
+
)
|
|
34
|
+
val target: JSArray<Double> = JSArray.doublesOf(major, minor, patch)
|
|
35
|
+
var i: Double = 0.0
|
|
36
|
+
while (i < parts.length) {
|
|
37
|
+
if (parts.numberAt(i) != target.numberAt(i)) {
|
|
38
|
+
return parts.numberAt(i) > target.numberAt(i)
|
|
39
|
+
}
|
|
40
|
+
i += 1.0
|
|
41
|
+
}
|
|
42
|
+
return (match ?: jsObjectRequired()).get(4.0) == null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@JvmField var typedArrayToByteArray: Boolean? = null
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Whether the Android runtime copies a typed array passed to a Java `byte[]` parameter. Older
|
|
49
|
+
* runtimes mis-pass it, so this is gated on the version rather than probed.
|
|
50
|
+
*/
|
|
51
|
+
fun runtimeCopiesTypedArraysToByteArrays(): Boolean {
|
|
52
|
+
if (Core_utils_android_runtime_version.typedArrayToByteArray == null) {
|
|
53
|
+
Core_utils_android_runtime_version.typedArrayToByteArray =
|
|
54
|
+
Core_utils_android_runtime_version.isVersionAtLeast(
|
|
55
|
+
jsGet((jsGlobalThis), "__runtimeVersion"),
|
|
56
|
+
9.0,
|
|
57
|
+
1.0,
|
|
58
|
+
2.0,
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
return (Core_utils_android_runtime_version.typedArrayToByteArray ?: false)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
fun __init() {
|
|
65
|
+
try {
|
|
66
|
+
semverPattern =
|
|
67
|
+
jsRegExpLiteral(
|
|
68
|
+
"^(\\d+)\\.(\\d+)\\.(\\d+)(-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?\$",
|
|
69
|
+
"",
|
|
70
|
+
)
|
|
71
|
+
} catch (__e: Throwable) {
|
|
72
|
+
jsReportThrown(__e)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|