@nstudio/nativescript-compiler 9.2.0-alpha.17 → 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/kotlin/access.js +8 -7
- 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 +4 -9
- package/dist/kotlin/class-methods.js +2 -2
- package/dist/kotlin/core-api.js +1 -1
- package/dist/kotlin/declarations.js +1 -1
- package/dist/kotlin/expression-statements.js +13 -1
- package/dist/kotlin/functions.js +1 -0
- package/dist/kotlin/literals.js +4 -8
- package/dist/kotlin/names.js +4 -4
- package/dist/kotlin/native/api.js +1 -1
- package/dist/kotlin/operators.js +25 -25
- package/dist/kotlin/optional-chains.js +1 -1
- package/dist/kotlin/overrides.js +2 -2
- package/dist/kotlin/state-backend.js +6 -2
- package/dist/kotlin/translator.js +1 -1
- package/dist/kotlin/types.js +4 -4
- package/dist/semantics/classes.js +15 -0
- package/dist/semantics/facts.js +1 -1
- package/dist/semantics/lang.js +10 -0
- package/dist/semantics/lower.js +54 -0
- package/dist/semantics/lowering-methods.js +5 -0
- package/dist/semantics/placement.js +9 -3
- package/dist/semantics/signals.js +11 -0
- package/dist/semantics/states/missing.js +7 -0
- package/dist/semantics/tdz.js +54 -15
- package/dist/semantics/throws.js +1 -1
- package/dist/semantics/translator-methods.js +1 -1
- package/dist/swift/access.js +7 -9
- package/dist/swift/assignment.js +20 -14
- package/dist/swift/calls.js +6 -3
- package/dist/swift/classes.js +7 -9
- package/dist/swift/components.js +3 -3
- package/dist/swift/control-flow.js +1 -1
- package/dist/swift/conversion.js +5 -2
- package/dist/swift/core-api.js +2 -2
- package/dist/swift/declarations.js +1 -1
- 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 -1
- package/dist/swift/lenient.js +1 -6
- package/dist/swift/literals.js +8 -3
- package/dist/swift/modules.js +3 -3
- package/dist/swift/names.js +3 -3
- package/dist/swift/native/calls.js +1 -1
- package/dist/swift/object-classes.js +84 -1
- package/dist/swift/operators.js +31 -29
- package/dist/swift/placement.js +4 -3
- package/dist/swift/state-backend.js +3 -2
- package/dist/swift/static-calls.js +2 -3
- package/dist/swift/syntax.js +9 -5
- package/dist/swift/translator.js +1 -1
- package/dist/swift/type-facts.js +3 -3
- package/dist/swift/types.js +3 -3
- package/dist/targets/ios/build.js +1 -1
- 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 +497 -42
- 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 +22 -2
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Strings.kt +32 -18
- 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/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 +280 -9
- package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +3 -2
- package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +1 -0
- 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
|
@@ -111,52 +111,70 @@ public enum Core_application_helpers_common {
|
|
|
111
111
|
}
|
|
112
112
|
#sourceLocation()
|
|
113
113
|
public static var _toggleApplicationEventListenersHandler: ((Bool, ((Any?) throws -> Void)?) throws -> Void)?
|
|
114
|
+
public static let _pendingApplicationEventListeners: JSSet<Any?> = JSSet<Any?>()
|
|
114
115
|
public static func toggleApplicationEventListeners(_ toAdd: Bool, _ callback: @escaping (Any?) throws -> Void)
|
|
115
116
|
throws
|
|
116
117
|
{
|
|
117
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
118
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:150)
|
|
118
119
|
if jsTruthy(Core_application_helpers_common._toggleApplicationEventListenersHandler) {
|
|
119
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
120
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:151)
|
|
120
121
|
try jsCallable(
|
|
121
122
|
Core_application_helpers_common._toggleApplicationEventListenersHandler,
|
|
122
123
|
"_toggleApplicationEventListenersHandler")(toAdd, callback)
|
|
124
|
+
} else if toAdd {
|
|
125
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:153)
|
|
126
|
+
_ = try Core_application_helpers_common._pendingApplicationEventListeners.add(
|
|
127
|
+
FunctionCell_AnyOpt_to_Void.scriptOrNil("", 1, FunctionCell_AnyOpt_to_Void.present(callback)))
|
|
128
|
+
} else {
|
|
129
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:155)
|
|
130
|
+
_ = try Core_application_helpers_common._pendingApplicationEventListeners.delete(
|
|
131
|
+
FunctionCell_AnyOpt_to_Void.scriptOrNil("", 1, FunctionCell_AnyOpt_to_Void.present(callback)))
|
|
123
132
|
}
|
|
124
133
|
}
|
|
125
134
|
#sourceLocation()
|
|
126
135
|
public static func setToggleApplicationEventListenersCallback(
|
|
127
136
|
_ callback: @escaping (Bool, ((Any?) throws -> Void)?) throws -> Void
|
|
128
|
-
) {
|
|
129
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
137
|
+
) throws {
|
|
138
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:159)
|
|
130
139
|
Core_application_helpers_common._toggleApplicationEventListenersHandler = callback
|
|
140
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:161)
|
|
141
|
+
for __item1 in Core_application_helpers_common._pendingApplicationEventListeners {
|
|
142
|
+
let listener: (Any?) throws -> Void = try FunctionCell_AnyOpt_to_Void.present(
|
|
143
|
+
FunctionCell_AnyOpt_to_Void.fromScriptOrNil(__item1))
|
|
144
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:162)
|
|
145
|
+
try jsCallable(callback, "callback")(true, listener)
|
|
146
|
+
}
|
|
147
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:164)
|
|
148
|
+
Core_application_helpers_common._pendingApplicationEventListeners.clear()
|
|
131
149
|
}
|
|
132
150
|
#sourceLocation()
|
|
133
151
|
public static var _applicationPropertiesCallback: (() throws -> Any?)?
|
|
134
152
|
public static func getApplicationProperties() throws -> Any? {
|
|
135
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
153
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:171)
|
|
136
154
|
if jsTruthy(Core_application_helpers_common._applicationPropertiesCallback) {
|
|
137
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
155
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:172)
|
|
138
156
|
return try jsCallable(
|
|
139
157
|
Core_application_helpers_common._applicationPropertiesCallback, "_applicationPropertiesCallback")()
|
|
140
158
|
}
|
|
141
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
159
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:174)
|
|
142
160
|
return JSObject([("orientation", "unknown"), ("systemAppearance", jsNull)])
|
|
143
161
|
}
|
|
144
162
|
#sourceLocation()
|
|
145
163
|
public static func setApplicationPropertiesCallback(_ callback: @escaping () throws -> Any?) {
|
|
146
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
164
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:177)
|
|
147
165
|
Core_application_helpers_common._applicationPropertiesCallback = callback
|
|
148
166
|
}
|
|
149
167
|
#sourceLocation()
|
|
150
168
|
public static var _a11yUpdatePropertiesCallback: ((Any?) throws -> Void)?
|
|
151
169
|
public static func setA11yUpdatePropertiesCallback(_ callback: @escaping (Any?) throws -> Void) {
|
|
152
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
170
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:182)
|
|
153
171
|
Core_application_helpers_common._a11yUpdatePropertiesCallback = callback
|
|
154
172
|
}
|
|
155
173
|
#sourceLocation()
|
|
156
174
|
public static func updateA11yPropertiesCallback(_ view: Any?) throws {
|
|
157
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
175
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:185)
|
|
158
176
|
if jsTruthy(Core_application_helpers_common._a11yUpdatePropertiesCallback) {
|
|
159
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
177
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:186)
|
|
160
178
|
try jsCallable(
|
|
161
179
|
Core_application_helpers_common._a11yUpdatePropertiesCallback, "_a11yUpdatePropertiesCallback")(view)
|
|
162
180
|
}
|
|
@@ -164,12 +182,12 @@ public enum Core_application_helpers_common {
|
|
|
164
182
|
#sourceLocation()
|
|
165
183
|
public static var _imageFetcher: Any? = nil
|
|
166
184
|
public static func getImageFetcher() -> Any? {
|
|
167
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
185
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:195)
|
|
168
186
|
return Core_application_helpers_common._imageFetcher
|
|
169
187
|
}
|
|
170
188
|
#sourceLocation()
|
|
171
189
|
public static func setImageFetcher(_ fetcher: Any?) {
|
|
172
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
190
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:198)
|
|
173
191
|
Core_application_helpers_common._imageFetcher = fetcher
|
|
174
192
|
}
|
|
175
193
|
#sourceLocation()
|
|
@@ -177,47 +195,47 @@ public enum Core_application_helpers_common {
|
|
|
177
195
|
public static func initImageCache(
|
|
178
196
|
_ context: Any?, _ mode: Double? = nil, _ memoryCacheSize: Double = 0.25, _ diskCacheSize: Double? = nil
|
|
179
197
|
) throws {
|
|
180
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
198
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:208)
|
|
181
199
|
let mode: Double = mode ?? CacheMode__helpers_common.diskAndMemory
|
|
182
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
200
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:208)
|
|
183
201
|
let diskCacheSize: Double = diskCacheSize ?? 10 * 1024 * 1024
|
|
184
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
202
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:209)
|
|
185
203
|
if jsLenientNumberEquals(Core_application_helpers_common._currentCacheMode, mode) {
|
|
186
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
204
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:210)
|
|
187
205
|
return
|
|
188
206
|
}
|
|
189
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
207
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:213)
|
|
190
208
|
Core_application_helpers_common._currentCacheMode = mode
|
|
191
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
209
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:214)
|
|
192
210
|
if !jsTruthy(Core_application_helpers_common.getImageFetcher()) {
|
|
193
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
211
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:215)
|
|
194
212
|
try Core_application_helpers_common.setImageFetcher(
|
|
195
213
|
jsCallMethod(
|
|
196
214
|
jsGet(jsGet(jsGet(jsGet(jsMoot("org"), "nativescript"), "widgets"), "image"), "Fetcher"),
|
|
197
215
|
"getInstance", context))
|
|
198
216
|
} else {
|
|
199
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
217
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:217)
|
|
200
218
|
_ = try jsCallMethod(Core_application_helpers_common.getImageFetcher(), "clearCache")
|
|
201
219
|
}
|
|
202
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
220
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:220)
|
|
203
221
|
let params: Any? = try NativeScriptKit.jsConstruct(
|
|
204
222
|
jsGet(jsGet(jsGet(jsGet(jsGet(jsMoot("org"), "nativescript"), "widgets"), "image"), "Cache"), "CacheParams")
|
|
205
223
|
)
|
|
206
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
224
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:221)
|
|
207
225
|
try jsSet(params, "memoryCacheEnabled", !jsLenientNumberEquals(mode, CacheMode__helpers_common.none))
|
|
208
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
226
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:222)
|
|
209
227
|
_ = try jsCallMethod(params, "setMemCacheSizePercent", memoryCacheSize)
|
|
210
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
228
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:223)
|
|
211
229
|
try jsSet(params, "diskCacheEnabled", jsLenientNumberEquals(mode, CacheMode__helpers_common.diskAndMemory))
|
|
212
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
230
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:224)
|
|
213
231
|
try jsSet(params, "diskCacheSize", diskCacheSize)
|
|
214
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
232
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:225)
|
|
215
233
|
let imageCache: Any? = try jsCallMethod(
|
|
216
234
|
jsGet(jsGet(jsGet(jsGet(jsMoot("org"), "nativescript"), "widgets"), "image"), "Cache"), "getInstance",
|
|
217
235
|
params)
|
|
218
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
236
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:226)
|
|
219
237
|
_ = try jsCallMethod(Core_application_helpers_common.getImageFetcher(), "addImageCache", imageCache)
|
|
220
|
-
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:
|
|
238
|
+
#sourceLocation(file:"@nativescript/core/application.helpers-common.ts",line:227)
|
|
221
239
|
_ = try jsCallMethod(Core_application_helpers_common.getImageFetcher(), "initCache")
|
|
222
240
|
}
|
|
223
241
|
}
|
|
@@ -184,7 +184,9 @@ public func __init_Connectivity() {
|
|
|
184
184
|
NativeScriptKit.jsConstruct(
|
|
185
185
|
interop.FunctionReference,
|
|
186
186
|
FunctionCell_AnyOpt_Double_AnyOpt_to_Void.script(
|
|
187
|
-
"_reachabilityCallback", 3,
|
|
187
|
+
"_reachabilityCallback", 3,
|
|
188
|
+
FunctionCell_AnyOpt_Double_AnyOpt_to_Void.declared(
|
|
189
|
+
"Connectivity._reachabilityCallback", { try Connectivity._reachabilityCallback($0, $1, $2) }))))
|
|
188
190
|
}
|
|
189
191
|
}
|
|
190
192
|
#sourceLocation()
|
|
@@ -34,111 +34,153 @@ public enum Core_css_mediaquery_index {
|
|
|
34
34
|
public static let RE_RESOLUTION_UNIT: JSRegExp = jsRegExpLiteral("(dpi|dpcm|dppx)?\\s*$", "")
|
|
35
35
|
public static let RESERVED_MEDIA_TYPES: JSSet<String> = JSSet<String>(
|
|
36
36
|
JSArray<String>(["only", "not", "and", "or", "layer"]))
|
|
37
|
+
public static let EVALUABLE_FEATURES: JSSet<String> = JSSet<String>(
|
|
38
|
+
JSArray<String>(["width", "height", "device-width", "device-height", "orientation", "prefers-color-scheme"]))
|
|
39
|
+
public static let parsedQueryCache: JSMap<String, JSArray<Any?>> = JSMap<String, JSArray<Any?>>()
|
|
40
|
+
public static func getParsedQuery(_ mediaQuery: String) throws -> JSArray<Any?>? {
|
|
41
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:57)
|
|
42
|
+
var expressions: JSArray<Any?>? = Core_css_mediaquery_index.parsedQueryCache.get(mediaQuery)
|
|
43
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:58)
|
|
44
|
+
if !jsTruthy(expressions as Any?) {
|
|
45
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:59)
|
|
46
|
+
expressions = try Core_css_mediaquery_index.parseQuery(mediaQuery)
|
|
47
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:60)
|
|
48
|
+
_ = try Core_css_mediaquery_index.parsedQueryCache.set(mediaQuery, jsObjectRequired(expressions))
|
|
49
|
+
}
|
|
50
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:63)
|
|
51
|
+
return expressions
|
|
52
|
+
}
|
|
53
|
+
#sourceLocation()
|
|
54
|
+
/// Whether a media query is valid and uses only features the runtime can evaluate.
|
|
55
|
+
/// @param mediaQuery The media query string.
|
|
56
|
+
public static func isEvaluableMediaQuery(_ mediaQuery: String) throws -> Bool {
|
|
57
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:71)
|
|
58
|
+
var expressions: JSArray<Any?>? = nil
|
|
59
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:73)
|
|
60
|
+
do {
|
|
61
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:74)
|
|
62
|
+
expressions = try Core_css_mediaquery_index.getParsedQuery(mediaQuery)
|
|
63
|
+
} catch {
|
|
64
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:76)
|
|
65
|
+
return false
|
|
66
|
+
}
|
|
67
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:79)
|
|
68
|
+
return try jsUnwrap(expressions, "every").every({ (query: Any?) throws -> Bool in
|
|
69
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:79)
|
|
70
|
+
return try jsUnwrap(jsArrayOrNil(jsGet(query, "features"), as: JSArray<Any?>.self, { $0 }), "every").every({
|
|
71
|
+
(feature: Any?) throws -> Bool in
|
|
72
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:79)
|
|
73
|
+
return try Core_css_mediaquery_index.EVALUABLE_FEATURES.has(
|
|
74
|
+
jsConvertedString(jsGet(feature, "property")))
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
#sourceLocation()
|
|
37
79
|
public static func matchQuery(_ mediaQuery: String, _ values: Any?) throws -> Bool {
|
|
38
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
39
|
-
let expressions: JSArray<Any?>? = try Core_css_mediaquery_index.
|
|
40
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
80
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:83)
|
|
81
|
+
let expressions: JSArray<Any?>? = try Core_css_mediaquery_index.getParsedQuery(mediaQuery)
|
|
82
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:85)
|
|
41
83
|
return try jsUnwrap(expressions, "some").some({ (query: Any?) throws -> Bool in
|
|
42
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
84
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:86)
|
|
43
85
|
let __d_1: Any? = query
|
|
44
86
|
_ = (try jsConvertedString((try jsGet(__d_1, "type"))))
|
|
45
87
|
let inverse: Bool = (try jsConvertedBool((try jsGet(__d_1, "inverse"))))
|
|
46
88
|
let features: JSArray<Any?>? = jsArrayOrNil((try jsGet(__d_1, "features")), as: JSArray<Any?>.self, { $0 })
|
|
47
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
89
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:90)
|
|
48
90
|
let typeMatch: Bool =
|
|
49
91
|
try jsStrictEquals(jsGet(query, "type"), "all")
|
|
50
92
|
|| jsStrictEquals(jsGet(values, "type"), jsGet(query, "type"))
|
|
51
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
93
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:93)
|
|
52
94
|
if !typeMatch {
|
|
53
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
95
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:94)
|
|
54
96
|
return inverse
|
|
55
97
|
}
|
|
56
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
98
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:97)
|
|
57
99
|
let expressionsMatch: Bool = try jsUnwrap(features, "every").every({ (feature: Any?) throws -> Bool in
|
|
58
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
100
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:98)
|
|
59
101
|
let value: Any? = try jsGet(values, jsConvertedString(jsGet(feature, "property")))
|
|
60
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
102
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:101)
|
|
61
103
|
if !jsTruthy(value) && !jsStrictEquals(value, Double(0)) {
|
|
62
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
104
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:102)
|
|
63
105
|
return false
|
|
64
106
|
}
|
|
65
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
107
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:105)
|
|
66
108
|
switch try jsConvertedString(jsGet(feature, "property")) {
|
|
67
109
|
case "orientation", "prefers-color-scheme":
|
|
68
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
110
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:108)
|
|
69
111
|
if !jsStringEquals(jsTypeof(value), "string") {
|
|
70
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
112
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:109)
|
|
71
113
|
return false
|
|
72
114
|
}
|
|
73
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
115
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:112)
|
|
74
116
|
return try jsStringEquals(
|
|
75
117
|
jsLenientString(value).lowercased(), jsConvertedString(jsGet(feature, "value")).lowercased())
|
|
76
118
|
default:
|
|
77
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
119
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:115)
|
|
78
120
|
var numVal: Double? = nil
|
|
79
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
121
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:117)
|
|
80
122
|
if !jsStringEquals(jsTypeof(value), "number") {
|
|
81
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
123
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:118)
|
|
82
124
|
try NativeScriptKit.Trace.write(
|
|
83
125
|
"Unknown CSS media query feature property: '\(jsConvertedString(jsGet(feature, "property")))' on '\(jsToStringThrowing(query))'",
|
|
84
126
|
NativeScriptKit.Trace.categories.MediaQuery, NativeScriptKit.Trace.messageType.warn)
|
|
85
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
127
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:119)
|
|
86
128
|
return false
|
|
87
129
|
}
|
|
88
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
130
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:122)
|
|
89
131
|
switch try jsConvertedString(jsGet(feature, "property")) {
|
|
90
132
|
case "width", "height", "device-width", "device-height":
|
|
91
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
133
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:127)
|
|
92
134
|
numVal = try jsCallable(NativeScriptKit.Length.toDevicePixels, "Length.toDevicePixels")(
|
|
93
135
|
NativeScriptKit.Length.parse(jsGet(feature, "value")), 0)
|
|
94
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
136
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:128)
|
|
95
137
|
break
|
|
96
138
|
default:
|
|
97
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
139
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:131)
|
|
98
140
|
try NativeScriptKit.Trace.write(
|
|
99
141
|
"Unknown CSS media query feature property: '\(jsConvertedString(jsGet(feature, "property")))' on '\(jsToStringThrowing(query))'",
|
|
100
142
|
NativeScriptKit.Trace.categories.MediaQuery, NativeScriptKit.Trace.messageType.warn)
|
|
101
143
|
}
|
|
102
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
144
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:135)
|
|
103
145
|
switch try jsConvertedString(jsGet(feature, "modifier")) {
|
|
104
146
|
case "min":
|
|
105
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
147
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:137)
|
|
106
148
|
return jsLenientNumber(value) >= (numVal ?? .nan)
|
|
107
149
|
case "max":
|
|
108
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
150
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:139)
|
|
109
151
|
return jsLenientNumber(value) <= (numVal ?? .nan)
|
|
110
152
|
default:
|
|
111
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
153
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:141)
|
|
112
154
|
return jsLenientNumberEquals(jsLenientNumber(value), (numVal ?? .nan))
|
|
113
155
|
}
|
|
114
156
|
}
|
|
115
157
|
return false
|
|
116
158
|
})
|
|
117
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
159
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:149)
|
|
118
160
|
return (inverse ? !expressionsMatch : expressionsMatch)
|
|
119
161
|
})
|
|
120
162
|
}
|
|
121
163
|
#sourceLocation()
|
|
122
164
|
public static func parseQuery(_ mediaQuery: String) throws -> JSArray<Any?>? {
|
|
123
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
165
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:154)
|
|
124
166
|
let mediaQueryStrings: JSArray<String>? = jsSplit(mediaQuery, ",", nil)
|
|
125
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
167
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:156)
|
|
126
168
|
return try (jsUnwrap(mediaQueryStrings, "map") as JSArray<String>).map({ (query: String) throws -> Any? in
|
|
127
169
|
var query = query
|
|
128
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
170
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:157)
|
|
129
171
|
query = jsTrim(query)
|
|
130
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
172
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:159)
|
|
131
173
|
let captures: JSMatch? = jsMatch(query, Core_css_mediaquery_index.RE_MEDIA_QUERY)
|
|
132
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
174
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:162)
|
|
133
175
|
if !jsTruthy(captures as Any?) {
|
|
134
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
176
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:163)
|
|
135
177
|
throw JSException(value: JSSyntaxError("Invalid CSS media query: '\(query)'"))
|
|
136
178
|
}
|
|
137
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
179
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:166)
|
|
138
180
|
let modifier: String? = try (jsUnwrap(captures, "1").values.element(1) ?? nil)
|
|
139
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
181
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:167)
|
|
140
182
|
let type: String? = try (jsUnwrap(captures, "2").values.element(2) ?? nil)
|
|
141
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
183
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:168)
|
|
142
184
|
let featureString: String = try jsTrim(
|
|
143
185
|
((({ () throws -> String in
|
|
144
186
|
let __v_1 = try (jsUnwrap(captures, "3").values.element(3) ?? nil)
|
|
@@ -148,34 +190,34 @@ public enum Core_css_mediaquery_index {
|
|
|
148
190
|
let __v_2 = try (jsUnwrap(captures, "4").values.element(4) ?? nil)
|
|
149
191
|
return jsTruthy(__v_2) ? jsPresent(__v_2) : ""
|
|
150
192
|
}()))))
|
|
151
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
193
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:170)
|
|
152
194
|
let mediaType: String = (jsTruthy(type as Any?) ? (type ?? "undefined").lowercased() : MediaQueryType.all)
|
|
153
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
195
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:171)
|
|
154
196
|
if Core_css_mediaquery_index.RESERVED_MEDIA_TYPES.has(mediaType) {
|
|
155
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
197
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:172)
|
|
156
198
|
return JSObject([("inverse", true), ("type", MediaQueryType.all), ("features", JSArray<Any?>())])
|
|
157
199
|
}
|
|
158
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
200
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:175)
|
|
159
201
|
let expression: Any? = JSObject([
|
|
160
202
|
(
|
|
161
203
|
"inverse",
|
|
162
204
|
jsTruthy(modifier as Any?) && jsStringEquals((modifier ?? "undefined").lowercased(), "not")
|
|
163
205
|
), ("type", mediaType), ("features", JSArray<Any?>()),
|
|
164
206
|
])
|
|
165
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
207
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:182)
|
|
166
208
|
if !jsTruthy(featureString) {
|
|
167
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
209
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:183)
|
|
168
210
|
return expression
|
|
169
211
|
}
|
|
170
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
212
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:187)
|
|
171
213
|
let features: JSMatch? = jsMatch(featureString, jsRegExpLiteral("\\([^\\)]+\\)", "g"))
|
|
172
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
214
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:190)
|
|
173
215
|
if !jsTruthy(features as Any?) {
|
|
174
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
216
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:191)
|
|
175
217
|
throw JSException(
|
|
176
218
|
value: JSSyntaxError("Invalid CSS media query features: '\(featureString)' on '\(query)'"))
|
|
177
219
|
}
|
|
178
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
220
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:194)
|
|
179
221
|
do {
|
|
180
222
|
let __it1 = try jsIterator(
|
|
181
223
|
jsIterated(features, "features is not iterable").values.map { (s: String?) in s ?? "" })
|
|
@@ -183,19 +225,19 @@ public enum Core_css_mediaquery_index {
|
|
|
183
225
|
while try __it1.jsAdvance() {
|
|
184
226
|
let feature: String = __it1.jsCurrent
|
|
185
227
|
do {
|
|
186
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
228
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:195)
|
|
187
229
|
let captures: JSMatch? = jsMatch(feature, Core_css_mediaquery_index.RE_MQ_EXPRESSION)
|
|
188
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
230
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:198)
|
|
189
231
|
if !jsTruthy(captures as Any?) {
|
|
190
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
232
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:199)
|
|
191
233
|
throw JSException(
|
|
192
234
|
value: JSSyntaxError("Invalid CSS media query feature: '\(feature)' on '\(query)'"))
|
|
193
235
|
}
|
|
194
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
236
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:202)
|
|
195
237
|
let featureData: JSMatch? = try jsMatch(
|
|
196
238
|
jsUnwrap((jsUnwrap(captures, "1").values.element(1) ?? nil), "toLowerCase")
|
|
197
239
|
.lowercased(), Core_css_mediaquery_index.RE_MQ_FEATURE)
|
|
198
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
240
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:204)
|
|
199
241
|
_ = try jsUnwrap(
|
|
200
242
|
jsArrayOrNil(jsGet(expression, "features"), as: JSArray<Any?>.self, { $0 }), "push"
|
|
201
243
|
).push(
|
|
@@ -212,7 +254,7 @@ public enum Core_css_mediaquery_index {
|
|
|
212
254
|
}
|
|
213
255
|
try __it1.jsCloseChecked()
|
|
214
256
|
}
|
|
215
|
-
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:
|
|
257
|
+
#sourceLocation(file:"@nativescript/core/css-mediaquery.index.ts",line:211)
|
|
216
258
|
return expression
|
|
217
259
|
})
|
|
218
260
|
}
|
|
@@ -100,7 +100,7 @@ open class CSS3Parser: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
100
100
|
#sourceLocation(file:"@nativescript/core/css.CSS3Parser.ts",line:169)
|
|
101
101
|
self.nextInputCodePointIndex += 1
|
|
102
102
|
#sourceLocation(file:"@nativescript/core/css.CSS3Parser.ts",line:171)
|
|
103
|
-
return (char
|
|
103
|
+
return (char as Any?)
|
|
104
104
|
case "#":
|
|
105
105
|
#sourceLocation(file:"@nativescript/core/css.CSS3Parser.ts",line:173)
|
|
106
106
|
return try
|
|
@@ -272,7 +272,7 @@ public enum Core_css_parser {
|
|
|
272
272
|
#sourceLocation(file:"@nativescript/core/css.parser.ts",line:195)
|
|
273
273
|
let unit: Any? = try
|
|
274
274
|
({ () throws -> Any? in
|
|
275
|
-
let __v_5 = try ((jsUnwrap(result, "2").values.element(2) ?? nil)
|
|
275
|
+
let __v_5 = try ((jsUnwrap(result, "2").values.element(2) ?? nil) as Any?)
|
|
276
276
|
return jsTruthy(__v_5) ? __v_5 : "dip"
|
|
277
277
|
}())
|
|
278
278
|
#sourceLocation(file:"@nativescript/core/css.parser.ts",line:197)
|
|
@@ -131,10 +131,10 @@ open class ObservableArray: Observable, JSStringConvertible, JSToJSONConvertible
|
|
|
131
131
|
return JSGenerator<Any?> { (__gen1: JSGeneratorContext) throws -> Void in
|
|
132
132
|
#sourceLocation(file:"@nativescript/core/data.observable-array.index.ts",line:98)
|
|
133
133
|
var __it1 = try jsIterated(self._array, "this._array is not iterable").makeIterator()
|
|
134
|
-
let __break1: () -> Void = { () -> Void in
|
|
134
|
+
let __break1: @MainActor () -> Void = { () -> Void in
|
|
135
135
|
__gen1.returnValue()
|
|
136
136
|
}
|
|
137
|
-
JSAsyncLoop().run { (__continue1: @escaping () -> Void) -> Void in
|
|
137
|
+
JSAsyncLoop().run { (__continue1: @escaping @MainActor () -> Void) -> Void in
|
|
138
138
|
guard let __item1 = __it1.next() else {
|
|
139
139
|
__break1()
|
|
140
140
|
return
|
|
@@ -471,53 +471,62 @@ open class FileSystemAccess: JSDynamic, JSExpando, JSStaticKeyed {
|
|
|
471
471
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:296)
|
|
472
472
|
return JSPromise<Bool> { (__resolvers1: JSResolvers<Bool>) throws -> Void in
|
|
473
473
|
let reject: (Any?) -> Void = { __resolvers1.reject($0) }
|
|
474
|
-
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
474
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:297)
|
|
475
|
+
do {
|
|
476
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:298)
|
|
477
|
+
NSData.data(
|
|
478
|
+
withContentsOfFile: src,
|
|
479
|
+
completion: jsEnter { (__b0: Data) -> Void in
|
|
480
|
+
let data: NSData = (__b0 as NSData)
|
|
481
|
+
jsReport {
|
|
482
|
+
try
|
|
483
|
+
({ (data: NSData?) throws -> Void in
|
|
484
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:299)
|
|
485
|
+
if !jsTruthy(data) {
|
|
486
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:300)
|
|
487
|
+
try jsCallable(reject, "reject")(JSError("Failed to read file at path '" + src))
|
|
488
|
+
} else {
|
|
489
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:302)
|
|
490
|
+
try jsUnwrap(data, "writeToFileAtomicallyCompletion").write(
|
|
491
|
+
toFile: dest, atomically: true,
|
|
492
|
+
completion: jsEnter { () -> Void in
|
|
493
|
+
jsReport {
|
|
494
|
+
try
|
|
495
|
+
({ () throws -> Void in
|
|
496
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:303)
|
|
497
|
+
if try self.fileExists(dest) {
|
|
498
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:304)
|
|
499
|
+
let size: Double = try self.getFileSize(dest)
|
|
500
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:305)
|
|
501
|
+
if try jsLenientNumberEquals(
|
|
502
|
+
size, Double(jsUnwrap(data, "length").length))
|
|
503
|
+
{
|
|
504
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:306)
|
|
505
|
+
__resolvers1.resolve(true)
|
|
506
|
+
} else {
|
|
507
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:308)
|
|
508
|
+
try jsCallable(reject, "reject")(
|
|
509
|
+
JSError("Failed to write file at path '" + dest)
|
|
510
|
+
)
|
|
511
|
+
}
|
|
504
512
|
} else {
|
|
505
|
-
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:
|
|
513
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:311)
|
|
506
514
|
try jsCallable(reject, "reject")(
|
|
507
515
|
JSError("Failed to write file at path '" + dest))
|
|
508
516
|
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
517
|
+
})()
|
|
518
|
+
}
|
|
519
|
+
})
|
|
520
|
+
}
|
|
521
|
+
})(data)
|
|
522
|
+
}
|
|
523
|
+
})
|
|
524
|
+
} catch {
|
|
525
|
+
#sourceLocation()
|
|
526
|
+
let ex: Any? = jsCaught(error)
|
|
527
|
+
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:317)
|
|
528
|
+
try jsCallable(reject, "reject")(ex)
|
|
529
|
+
}
|
|
521
530
|
}
|
|
522
531
|
}
|
|
523
532
|
#sourceLocation()
|