@nstudio/nativescript-compiler 9.2.0-alpha.17 → 9.2.0-alpha.19
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/config.js +1 -0
- package/dist/kotlin/access.js +8 -7
- package/dist/kotlin/arguments.js +6 -0
- 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 +3 -3
- 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/conversion.js +9 -1
- 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/runtime.js +1 -0
- 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 +2 -2
- package/dist/semantics/translator-methods.js +1 -1
- package/dist/swift/access.js +7 -9
- package/dist/swift/arguments.js +14 -9
- package/dist/swift/assignment.js +26 -15
- package/dist/swift/calls.js +13 -5
- package/dist/swift/class-methods.js +2 -1
- 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/library.js +2 -2
- package/dist/swift/literals.js +8 -3
- package/dist/swift/method-values.js +2 -1
- package/dist/swift/modules.js +3 -3
- package/dist/swift/names.js +7 -7
- package/dist/swift/native/calls.js +10 -4
- package/dist/swift/object-classes.js +84 -1
- package/dist/swift/operators.js +31 -29
- package/dist/swift/placement.js +22 -6
- package/dist/swift/state-backend.js +3 -2
- package/dist/swift/static-calls.js +3 -4
- package/dist/swift/syntax.js +10 -6
- package/dist/swift/translator.js +1 -1
- package/dist/swift/type-facts.js +3 -3
- package/dist/swift/types.js +5 -5
- 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/fromcore/kotlin/org/nativescript/kit/NativeScriptApplication.kt +9 -0
- 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 +7 -3
- 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 +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +58 -49
- package/kit-apple/Sources/NativeScriptKit/Core/file-system.index.swift +10 -10
- 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 +67 -52
- package/kit-apple/Sources/NativeScriptKit/Core/http.index.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +69 -53
- package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +4 -22
- package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +144 -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.action-bar.index.ios.swift +33 -21
- package/kit-apple/Sources/NativeScriptKit/Core/ui.activity-indicator.index.ios.swift +12 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.index.ios.swift +77 -65
- package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.keyframe-animation.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +10 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +14 -13
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +1273 -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 +87 -67
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.date-picker.index.ios.swift +17 -16
- package/kit-apple/Sources/NativeScriptKit/Core/ui.dialogs.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.editable-text-base.index.ios.swift +27 -18
- 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.html-view.index.ios.swift +9 -9
- package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +6 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +8 -8
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +22 -21
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.layout-base.ios.swift +4 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass-container.index.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass.index.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.root-layout-common.swift +9 -9
- package/kit-apple/Sources/NativeScriptKit/Core/ui.list-picker.index.ios.swift +9 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +38 -20
- package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +204 -190
- package/kit-apple/Sources/NativeScriptKit/Core/ui.progress.index.ios.swift +12 -10
- package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +2 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +18 -9
- package/kit-apple/Sources/NativeScriptKit/Core/ui.search-bar.index.ios.swift +28 -18
- package/kit-apple/Sources/NativeScriptKit/Core/ui.segmented-bar.index.ios.swift +19 -12
- package/kit-apple/Sources/NativeScriptKit/Core/ui.slider.index.ios.swift +14 -12
- package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +17 -12
- 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.switch.index.ios.swift +12 -10
- package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +36 -20
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +3 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.index.ios.swift +25 -22
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.text-base-common.swift +2 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-field.index.ios.swift +21 -14
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.index.ios.swift +33 -21
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.time-picker.index.ios.swift +22 -18
- 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 +32 -32
- package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.index.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.web-view-common.swift +2 -2
- 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/utils.index.ios.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/Native.swift +2 -1
- 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 +6 -4
|
@@ -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
|
+
try __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()
|
|
@@ -680,7 +689,7 @@ open class FileSystemAccess: JSDynamic, JSExpando, JSStaticKeyed {
|
|
|
680
689
|
try jsCallable(reject, "reject")(error)
|
|
681
690
|
} else {
|
|
682
691
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:414)
|
|
683
|
-
__resolvers5.resolve()
|
|
692
|
+
try __resolvers5.resolve()
|
|
684
693
|
}
|
|
685
694
|
}))
|
|
686
695
|
} catch {
|
|
@@ -758,7 +767,7 @@ open class FileSystemAccess: JSDynamic, JSExpando, JSStaticKeyed {
|
|
|
758
767
|
try jsCallable(reject, "reject")(error)
|
|
759
768
|
} else {
|
|
760
769
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:458)
|
|
761
|
-
__resolvers6.resolve()
|
|
770
|
+
try __resolvers6.resolve()
|
|
762
771
|
}
|
|
763
772
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:460)
|
|
764
773
|
try jsUnwrap(handle, "closeFile").closeFile()
|
|
@@ -815,7 +824,7 @@ open class FileSystemAccess: JSDynamic, JSExpando, JSStaticKeyed {
|
|
|
815
824
|
try jsCallable(reject, "reject")(error)
|
|
816
825
|
} else {
|
|
817
826
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:491)
|
|
818
|
-
__resolvers7.resolve()
|
|
827
|
+
try __resolvers7.resolve()
|
|
819
828
|
}
|
|
820
829
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:493)
|
|
821
830
|
try jsUnwrap(handle, "closeFile").closeFile()
|
|
@@ -884,7 +893,7 @@ open class FileSystemAccess: JSDynamic, JSExpando, JSStaticKeyed {
|
|
|
884
893
|
try jsCallable(reject, "reject")(error)
|
|
885
894
|
} else {
|
|
886
895
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:528)
|
|
887
|
-
__resolvers8.resolve()
|
|
896
|
+
try __resolvers8.resolve()
|
|
888
897
|
}
|
|
889
898
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:530)
|
|
890
899
|
try jsUnwrap(handle, "closeFile").closeFile()
|
|
@@ -949,7 +958,7 @@ open class FileSystemAccess: JSDynamic, JSExpando, JSStaticKeyed {
|
|
|
949
958
|
try
|
|
950
959
|
({ () throws -> Void in
|
|
951
960
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:563)
|
|
952
|
-
__resolvers9.resolve()
|
|
961
|
+
try __resolvers9.resolve()
|
|
953
962
|
})()
|
|
954
963
|
}
|
|
955
964
|
})
|
|
@@ -993,7 +1002,7 @@ open class FileSystemAccess: JSDynamic, JSExpando, JSStaticKeyed {
|
|
|
993
1002
|
"", 0,
|
|
994
1003
|
{ () throws -> Void in
|
|
995
1004
|
#sourceLocation(file:"@nativescript/core/file-system.file-system-access.ios.ts",line:587)
|
|
996
|
-
__resolvers10.resolve()
|
|
1005
|
+
try __resolvers10.resolve()
|
|
997
1006
|
}))
|
|
998
1007
|
} catch {
|
|
999
1008
|
#sourceLocation()
|
|
@@ -100,7 +100,7 @@ open class FileSystemEntity: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
100
100
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:82)
|
|
101
101
|
if !hasError {
|
|
102
102
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:83)
|
|
103
|
-
__resolvers1.resolve(true)
|
|
103
|
+
try __resolvers1.resolve(true)
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -149,7 +149,7 @@ open class FileSystemEntity: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
149
149
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:116)
|
|
150
150
|
if !hasError {
|
|
151
151
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:117)
|
|
152
|
-
__resolvers2.resolve(true)
|
|
152
|
+
try __resolvers2.resolve(true)
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -500,7 +500,7 @@ open class File: FileSystemEntity {
|
|
|
500
500
|
"", 0,
|
|
501
501
|
{ () throws -> Void in
|
|
502
502
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:379)
|
|
503
|
-
__resolvers3.resolve()
|
|
503
|
+
try __resolvers3.resolve()
|
|
504
504
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:380)
|
|
505
505
|
self._locked = false
|
|
506
506
|
}),
|
|
@@ -573,7 +573,7 @@ open class File: FileSystemEntity {
|
|
|
573
573
|
"", 0,
|
|
574
574
|
{ () throws -> Void in
|
|
575
575
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:426)
|
|
576
|
-
__resolvers4.resolve(true)
|
|
576
|
+
try __resolvers4.resolve(true)
|
|
577
577
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:427)
|
|
578
578
|
self._locked = false
|
|
579
579
|
}),
|
|
@@ -646,7 +646,7 @@ open class File: FileSystemEntity {
|
|
|
646
646
|
"", 1,
|
|
647
647
|
{ (result: Any?) throws -> Void in
|
|
648
648
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:473)
|
|
649
|
-
__resolvers5.resolve(try jsConvertedBool(result))
|
|
649
|
+
try __resolvers5.resolve(try jsConvertedBool(result))
|
|
650
650
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:474)
|
|
651
651
|
self._locked = false
|
|
652
652
|
}),
|
|
@@ -712,7 +712,7 @@ open class File: FileSystemEntity {
|
|
|
712
712
|
"", 1,
|
|
713
713
|
{ (result: Any?) throws -> Void in
|
|
714
714
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:520)
|
|
715
|
-
__resolvers6.resolve(result)
|
|
715
|
+
try __resolvers6.resolve(result)
|
|
716
716
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:521)
|
|
717
717
|
self._locked = false
|
|
718
718
|
}),
|
|
@@ -778,7 +778,7 @@ open class File: FileSystemEntity {
|
|
|
778
778
|
"", 0,
|
|
779
779
|
{ () throws -> Void in
|
|
780
780
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:567)
|
|
781
|
-
__resolvers7.resolve()
|
|
781
|
+
try __resolvers7.resolve()
|
|
782
782
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:568)
|
|
783
783
|
self._locked = false
|
|
784
784
|
}),
|
|
@@ -850,7 +850,7 @@ open class File: FileSystemEntity {
|
|
|
850
850
|
"", 1,
|
|
851
851
|
{ (result: Any?) throws -> Void in
|
|
852
852
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:614)
|
|
853
|
-
__resolvers8.resolve(try jsConvertedString(result))
|
|
853
|
+
try __resolvers8.resolve(try jsConvertedString(result))
|
|
854
854
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:615)
|
|
855
855
|
self._locked = false
|
|
856
856
|
}),
|
|
@@ -918,7 +918,7 @@ open class File: FileSystemEntity {
|
|
|
918
918
|
"", 0,
|
|
919
919
|
{ () throws -> Void in
|
|
920
920
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:660)
|
|
921
|
-
__resolvers9.resolve(true)
|
|
921
|
+
try __resolvers9.resolve(true)
|
|
922
922
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:661)
|
|
923
923
|
self._locked = false
|
|
924
924
|
}),
|
|
@@ -1118,7 +1118,7 @@ open class Folder: FileSystemEntity {
|
|
|
1118
1118
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:736)
|
|
1119
1119
|
if !hasError {
|
|
1120
1120
|
#sourceLocation(file:"@nativescript/core/file-system.index.ts",line:737)
|
|
1121
|
-
__resolvers10.resolve(true)
|
|
1121
|
+
try __resolvers10.resolve(true)
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
@@ -55,5 +55,23 @@ public enum Core_http_http_request_internal_http_request_internal_common {
|
|
|
55
55
|
#sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:22)
|
|
56
56
|
return JSObject([("method", method as Any?)])
|
|
57
57
|
}
|
|
58
|
+
#sourceLocation()
|
|
59
|
+
public static func getRequestBodyBytes(_ content: Any?) throws -> JSUint8Array? {
|
|
60
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:26)
|
|
61
|
+
if content is JSArrayBuffer {
|
|
62
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:27)
|
|
63
|
+
return try JSUint8Array(buffer: (jsCastPresent(content) as JSArrayBuffer))
|
|
64
|
+
}
|
|
65
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:29)
|
|
66
|
+
if JSArrayBuffer.isView(content) {
|
|
67
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:30)
|
|
68
|
+
return try JSUint8Array.from(
|
|
69
|
+
jsUnwrap(content as? JSArrayBufferView, "buffer").buffer,
|
|
70
|
+
jsUnwrap(content as? JSArrayBufferView, "byteOffset").byteOffset,
|
|
71
|
+
jsUnwrap(content as? JSArrayBufferView, "byteLength").byteLength)
|
|
72
|
+
}
|
|
73
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.http-request-internal-common.ts",line:33)
|
|
74
|
+
return nil
|
|
75
|
+
}
|
|
58
76
|
}
|
|
59
77
|
#sourceLocation()
|
|
@@ -157,38 +157,53 @@ public enum Core_http_http_request_internal_index {
|
|
|
157
157
|
(jsObjectRequired(
|
|
158
158
|
(NSString(string: jsLenientString(jsCallMethod(jsGet(options, "content"), "toString")))
|
|
159
159
|
.data(using: 4) as NSData?)) as Data?)
|
|
160
|
-
} else
|
|
160
|
+
} else {
|
|
161
161
|
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:91)
|
|
162
|
-
let
|
|
162
|
+
let bytes: JSUint8Array? =
|
|
163
|
+
try Core_http_http_request_internal_http_request_internal_common.getRequestBodyBytes(
|
|
164
|
+
jsGet(options, "content"))
|
|
163
165
|
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:92)
|
|
164
|
-
|
|
165
|
-
(
|
|
166
|
+
if jsTruthy(bytes) {
|
|
167
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:93)
|
|
168
|
+
let __d_1: JSUint8Array = try jsDestructured(bytes, "buffer")
|
|
169
|
+
let buffer: Any? = __d_1.buffer
|
|
170
|
+
let byteOffset: Double = __d_1.byteOffset
|
|
171
|
+
let byteLength: Double = __d_1.byteLength
|
|
172
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:94)
|
|
173
|
+
let body: Any? =
|
|
174
|
+
try
|
|
175
|
+
(byteOffset == 0 && jsStrictEquals(byteLength, jsGet(buffer, "byteLength"))
|
|
176
|
+
? buffer : jsCallMethod(buffer, "slice", byteOffset, byteOffset + byteLength))
|
|
177
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:95)
|
|
178
|
+
try jsUnwrap(urlRequest, setting: "HTTPBody").httpBody =
|
|
179
|
+
(NSData(data: jsNativeData(body)) as Data?)
|
|
180
|
+
}
|
|
166
181
|
}
|
|
167
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
182
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:99)
|
|
168
183
|
if try Core_utils_types.isNumber(jsGet(options, "timeout")) {
|
|
169
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
184
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:100)
|
|
170
185
|
try jsUnwrap(urlRequest, setting: "timeoutInterval").timeoutInterval = jsNativeNumber(
|
|
171
186
|
jsConvertedNumber(jsGet(options, "timeout")) / 1000)
|
|
172
187
|
}
|
|
173
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
188
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:103)
|
|
174
189
|
var session: URLSession?
|
|
175
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
190
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:104)
|
|
176
191
|
if try Core_utils_types.isBoolean(jsGet(options, "dontFollowRedirects"))
|
|
177
192
|
&& jsConvertedBool(jsGet(options, "dontFollowRedirects"))
|
|
178
193
|
{
|
|
179
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
194
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:105)
|
|
180
195
|
try Core_http_http_request_internal_index.ensureSessionNotFollowingRedirects()
|
|
181
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
196
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:106)
|
|
182
197
|
session = Core_http_http_request_internal_index.sessionNotFollowingRedirects
|
|
183
198
|
} else {
|
|
184
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
199
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:108)
|
|
185
200
|
try Core_http_http_request_internal_index.ensureDefaultSession()
|
|
186
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
201
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:109)
|
|
187
202
|
session = Core_http_http_request_internal_index.defaultSession
|
|
188
203
|
}
|
|
189
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
204
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:112)
|
|
190
205
|
var timestamp: Double = -1
|
|
191
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
206
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:113)
|
|
192
207
|
let dataTask: URLSessionDataTask? = try jsUnwrap(session, "dataTaskWithRequestCompletionHandler")
|
|
193
208
|
.dataTask(
|
|
194
209
|
with: (jsObjectRequired(urlRequest) as URLRequest),
|
|
@@ -199,24 +214,24 @@ public enum Core_http_http_request_internal_index {
|
|
|
199
214
|
jsReport {
|
|
200
215
|
try
|
|
201
216
|
({ (data: NSData?, response: HTTPURLResponse?, error: NSError?) throws -> Void in
|
|
202
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
217
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:114)
|
|
203
218
|
if jsTruthy(error) {
|
|
204
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
219
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:115)
|
|
205
220
|
try jsCallable(reject, "reject")(
|
|
206
221
|
JSError(jsUnwrap(error, "localizedDescription").localizedDescription))
|
|
207
222
|
} else {
|
|
208
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
223
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:117)
|
|
209
224
|
let headers: JSRecord<Any?> = JSRecord<Any?>()
|
|
210
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
225
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:118)
|
|
211
226
|
if try
|
|
212
227
|
(jsTruthy(response)
|
|
213
228
|
&& jsTruthy(jsUnwrap(response, "allHeaderFields").allHeaderFields))
|
|
214
229
|
{
|
|
215
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
230
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:119)
|
|
216
231
|
let headerFields: [AnyHashable: Any] = try jsUnwrap(
|
|
217
232
|
response, "allHeaderFields"
|
|
218
233
|
).allHeaderFields
|
|
219
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
234
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:121)
|
|
220
235
|
try
|
|
221
236
|
(jsUnwrap(headerFields, "enumerateKeysAndObjectsUsingBlock")
|
|
222
237
|
as NSDictionary).enumerateKeysAndObjects(
|
|
@@ -231,7 +246,7 @@ public enum Core_http_http_request_internal_index {
|
|
|
231
246
|
({
|
|
232
247
|
(key: Any?, value: Any?, stop: Any?) throws
|
|
233
248
|
-> Void in
|
|
234
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
249
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:122)
|
|
235
250
|
try
|
|
236
251
|
Core_http_http_request_internal_http_request_internal_common
|
|
237
252
|
.addHeader(
|
|
@@ -241,14 +256,14 @@ public enum Core_http_http_request_internal_index {
|
|
|
241
256
|
}
|
|
242
257
|
})
|
|
243
258
|
}
|
|
244
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
259
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:126)
|
|
245
260
|
if jsTruthy(debugRequest) {
|
|
246
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
261
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:127)
|
|
247
262
|
try jsSet(
|
|
248
263
|
debugRequest, "mimeType", jsUnwrap(response, "MIMEType").mimeType)
|
|
249
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
264
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:128)
|
|
250
265
|
try jsSet(debugRequest, "data", data)
|
|
251
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
266
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:129)
|
|
252
267
|
let debugResponse:
|
|
253
268
|
Object_url_status_statusText_headers_mimeType_fromDiskCache_timing_headersSize =
|
|
254
269
|
try
|
|
@@ -273,12 +288,12 @@ public enum Core_http_http_request_internal_index {
|
|
|
273
288
|
headersSize: jsNullishCoalesce(
|
|
274
289
|
((headers as JSRecord<Any?>?)?["length"] ?? nil),
|
|
275
290
|
Double(-1)))
|
|
276
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
291
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:155)
|
|
277
292
|
_ = try jsCallMethod(debugRequest, "responseReceived", debugResponse)
|
|
278
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
293
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:156)
|
|
279
294
|
_ = try jsCallMethod(debugRequest, "loadingFinished")
|
|
280
295
|
}
|
|
281
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
296
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:160)
|
|
282
297
|
let content: Any? = try JSObject([
|
|
283
298
|
("raw", data), ("requestURL", jsGet(options, "url")),
|
|
284
299
|
(
|
|
@@ -286,13 +301,13 @@ public enum Core_http_http_request_internal_index {
|
|
|
286
301
|
FunctionCell_none_to_JSPromise_AnyOpt_Opt.scriptOrNil(
|
|
287
302
|
"", 0,
|
|
288
303
|
{ () -> JSPromise<Any?> in
|
|
289
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
304
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:164)
|
|
290
305
|
return JSPromise<Any?> {
|
|
291
306
|
(__resolvers2: JSResolvers<Any?>) throws -> Void in
|
|
292
307
|
let rejectImage: (Any?) -> Void = {
|
|
293
308
|
__resolvers2.reject($0)
|
|
294
309
|
}
|
|
295
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
310
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:165)
|
|
296
311
|
UIImage.tns_decode(
|
|
297
312
|
with: (data as Data?),
|
|
298
313
|
completion: jsEnter { (__b0: UIImage?) -> Void in
|
|
@@ -300,12 +315,12 @@ public enum Core_http_http_request_internal_index {
|
|
|
300
315
|
jsReport {
|
|
301
316
|
try
|
|
302
317
|
({ (image: UIImage?) throws -> Void in
|
|
303
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
318
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:166)
|
|
304
319
|
if jsTruthy(image) {
|
|
305
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
306
|
-
__resolvers2.resolve(image)
|
|
320
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:167)
|
|
321
|
+
try __resolvers2.resolve(image)
|
|
307
322
|
} else {
|
|
308
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
323
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:169)
|
|
309
324
|
try jsCallable(
|
|
310
325
|
rejectImage, "rejectImage")(
|
|
311
326
|
JSError(
|
|
@@ -323,22 +338,22 @@ public enum Core_http_http_request_internal_index {
|
|
|
323
338
|
FunctionCell_DoubleOpt_to_String.scriptOrNil(
|
|
324
339
|
"", 1,
|
|
325
340
|
{ (encoding: Double?) throws -> String in
|
|
326
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
341
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:174)
|
|
327
342
|
return
|
|
328
343
|
try Core_http_http_request_internal_index.NSDataToString(
|
|
329
344
|
data, encoding)
|
|
330
345
|
})
|
|
331
346
|
),
|
|
332
347
|
])
|
|
333
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
348
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:177)
|
|
334
349
|
if try !jsIsNullish(contentHandler)
|
|
335
350
|
&& Core_utils_types.isObject(contentHandler)
|
|
336
351
|
&& !(JSArray<Any?>.isArray(contentHandler))
|
|
337
352
|
{
|
|
338
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
353
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:178)
|
|
339
354
|
_ = try jsObjectAssign(content, contentHandler)
|
|
340
355
|
}
|
|
341
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
356
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:181)
|
|
342
357
|
try __resolvers1.resolve(
|
|
343
358
|
JSObject([
|
|
344
359
|
("content", content),
|
|
@@ -349,11 +364,11 @@ public enum Core_http_http_request_internal_index {
|
|
|
349
364
|
})(data, response, error)
|
|
350
365
|
}
|
|
351
366
|
})
|
|
352
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
367
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:189)
|
|
353
368
|
if try (jsTruthy(jsGet(options, "url")) && jsTruthy(debugRequest)) {
|
|
354
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
369
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:190)
|
|
355
370
|
timestamp = JSDate.now() / 1000
|
|
356
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
371
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:191)
|
|
357
372
|
let request: Object_headers_timestamp_headersSize_method_postData_url = try {
|
|
358
373
|
() throws -> Object_headers_timestamp_headersSize_method_postData_url in
|
|
359
374
|
let __spread1: Any? =
|
|
@@ -371,37 +386,37 @@ public enum Core_http_http_request_internal_index {
|
|
|
371
386
|
? jsLenientString(jsField(__spread1, "url")) : jsLenientString(jsGet(options, "url"))),
|
|
372
387
|
jsOrder: ["url", "method", "postData", "headers", "timestamp", "headersSize"])
|
|
373
388
|
}()
|
|
374
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
389
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:198)
|
|
375
390
|
_ = try jsCallMethod(debugRequest, "requestWillBeSent", request)
|
|
376
391
|
}
|
|
377
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
392
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:201)
|
|
378
393
|
try jsUnwrap(dataTask, "resume").resume()
|
|
379
394
|
} catch {
|
|
380
395
|
let ex: Any? = jsCaught(error)
|
|
381
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
396
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:203)
|
|
382
397
|
try jsCallable(reject, "reject")(ex)
|
|
383
398
|
}
|
|
384
399
|
}
|
|
385
400
|
}
|
|
386
401
|
#sourceLocation()
|
|
387
402
|
public static func NSDataToString(_ data: Any?, _ encoding: Double? = nil) throws -> String {
|
|
388
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
403
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:209)
|
|
389
404
|
var code: Double = Double(NSUTF8StringEncoding)
|
|
390
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
405
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:211)
|
|
391
406
|
if jsLenientNumberEquals((encoding ?? .nan), HttpResponseEncoding.GBK) {
|
|
392
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
407
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:212)
|
|
393
408
|
code = Double(CFStringEncodings.GB_18030_2000.rawValue)
|
|
394
409
|
}
|
|
395
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
410
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:215)
|
|
396
411
|
var encodedString: NSString? = NSString(data: jsNativeData(data), encoding: jsNativeInteger(code, UInt.self))
|
|
397
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
412
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:218)
|
|
398
413
|
if !jsTruthy(encodedString) {
|
|
399
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
414
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:219)
|
|
400
415
|
code = Double(NSISOLatin1StringEncoding)
|
|
401
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
416
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:220)
|
|
402
417
|
encodedString = jsImplicit(NSString(data: jsNativeData(data), encoding: jsNativeInteger(code, UInt.self)))
|
|
403
418
|
}
|
|
404
|
-
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:
|
|
419
|
+
#sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:223)
|
|
405
420
|
return try jsUnwrap(encodedString, "toString").description
|
|
406
421
|
}
|
|
407
422
|
}
|
|
@@ -32,7 +32,7 @@ public enum Http {
|
|
|
32
32
|
#sourceLocation(file:"@nativescript/core/http.index.ts",line:11)
|
|
33
33
|
let str: String = try jsLenientString(jsCallMethod(jsGet(r, "content"), "toString"))
|
|
34
34
|
#sourceLocation(file:"@nativescript/core/http.index.ts",line:12)
|
|
35
|
-
__resolvers1.resolve(str)
|
|
35
|
+
try __resolvers1.resolve(str)
|
|
36
36
|
} catch {
|
|
37
37
|
let e: Any? = jsCaught(error)
|
|
38
38
|
#sourceLocation(file:"@nativescript/core/http.index.ts",line:14)
|
|
@@ -62,7 +62,7 @@ public enum Http {
|
|
|
62
62
|
#sourceLocation(file:"@nativescript/core/http.index.ts",line:27)
|
|
63
63
|
let json: Any? = try jsCallMethod(jsGet(r, "content"), "toJSON")
|
|
64
64
|
#sourceLocation(file:"@nativescript/core/http.index.ts",line:28)
|
|
65
|
-
__resolvers2.resolve(json)
|
|
65
|
+
try __resolvers2.resolve(json)
|
|
66
66
|
} catch {
|
|
67
67
|
let e: Any? = jsCaught(error)
|
|
68
68
|
#sourceLocation(file:"@nativescript/core/http.index.ts",line:30)
|
|
@@ -127,7 +127,7 @@ public enum Http {
|
|
|
127
127
|
let file: File? =
|
|
128
128
|
try jsCallMethod(jsGet(r, "content"), "toFile", (destinationFilePath as Any?)) as? File
|
|
129
129
|
#sourceLocation(file:"@nativescript/core/http.index.ts",line:61)
|
|
130
|
-
__resolvers4.resolve(file)
|
|
130
|
+
try __resolvers4.resolve(file)
|
|
131
131
|
} catch {
|
|
132
132
|
let e: Any? = jsCaught(error)
|
|
133
133
|
#sourceLocation(file:"@nativescript/core/http.index.ts",line:63)
|