@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
|
@@ -412,92 +412,100 @@ open class XMLHttpRequest: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
|
|
|
412
412
|
} else if data is JSArrayBuffer {
|
|
413
413
|
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:247)
|
|
414
414
|
try jsSet(self._options, "content", (data as? JSArrayBuffer))
|
|
415
|
+
} else if JSArrayBuffer.isView(data) {
|
|
416
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:249)
|
|
417
|
+
try jsSet(
|
|
418
|
+
self._options, "content",
|
|
419
|
+
JSUint8Array.from(
|
|
420
|
+
jsUnwrap(data as? JSArrayBufferView, "buffer").buffer,
|
|
421
|
+
jsUnwrap(data as? JSArrayBufferView, "byteOffset").byteOffset,
|
|
422
|
+
jsUnwrap(data as? JSArrayBufferView, "byteLength").byteLength))
|
|
415
423
|
}
|
|
416
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:250)
|
|
417
|
-
self._sendFlag = true
|
|
418
424
|
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:252)
|
|
419
|
-
|
|
425
|
+
self._sendFlag = true
|
|
420
426
|
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:254)
|
|
427
|
+
try self.emitEvent("loadstart", JSArray<Any?>())
|
|
428
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:256)
|
|
421
429
|
_ = try jsUnwrap(
|
|
422
430
|
jsUnwrap(Core_http_http_request_index.request(self._options), "then").then({ (r: Any?) throws -> Void in
|
|
423
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
431
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:258)
|
|
424
432
|
if !self._errorFlag && self._sendFlag {
|
|
425
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
433
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:259)
|
|
426
434
|
try self._loadResponse(r)
|
|
427
435
|
}
|
|
428
436
|
}), "catch"
|
|
429
437
|
).catch({ (e: Any?) throws -> Void in
|
|
430
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
438
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:263)
|
|
431
439
|
self._errorFlag = true
|
|
432
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
440
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:264)
|
|
433
441
|
self._sendFlag = false
|
|
434
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
442
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:265)
|
|
435
443
|
try self._setRequestError("error", e)
|
|
436
444
|
})
|
|
437
445
|
}
|
|
438
446
|
#sourceLocation()
|
|
439
447
|
open func setRequestHeader(_ header: String, _ value: String) throws {
|
|
440
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
448
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:270)
|
|
441
449
|
if !jsLenientNumberEquals(self._readyState, self.OPENED) || self._sendFlag {
|
|
442
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
450
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:271)
|
|
443
451
|
throw JSException(
|
|
444
452
|
value: JSError(
|
|
445
453
|
"Failed to execute 'setRequestHeader' on 'XMLHttpRequest': " + "The object's state must be OPENED.")
|
|
446
454
|
)
|
|
447
455
|
}
|
|
448
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
456
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:274)
|
|
449
457
|
if Core_utils_types.isString(header) && Core_utils_types.isString(value) {
|
|
450
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
458
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:275)
|
|
451
459
|
try jsSet(jsGet(self._options, "headers"), header, value)
|
|
452
460
|
}
|
|
453
461
|
}
|
|
454
462
|
#sourceLocation()
|
|
455
463
|
open func getAllResponseHeaders() throws -> String {
|
|
456
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
464
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:280)
|
|
457
465
|
if self._readyState < 2 || self._errorFlag {
|
|
458
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
466
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:281)
|
|
459
467
|
return ""
|
|
460
468
|
}
|
|
461
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:282)
|
|
462
|
-
var result: String = ""
|
|
463
469
|
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:284)
|
|
470
|
+
var result: String = ""
|
|
471
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:286)
|
|
464
472
|
for i in jsKeysOf(self._headers) {
|
|
465
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
473
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:287)
|
|
466
474
|
try result += i + ": " + jsToStringDefaultThrowing(jsGet(self._headers, i)) + "\r\n"
|
|
467
475
|
}
|
|
468
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
476
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:290)
|
|
469
477
|
return jsSubstr(result, 0, Double(result.utf16.count) - 2)
|
|
470
478
|
}
|
|
471
479
|
#sourceLocation()
|
|
472
480
|
open func getResponseHeader(_ header: String) throws -> String? {
|
|
473
481
|
var header = header
|
|
474
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
482
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:294)
|
|
475
483
|
if (Core_utils_types.isString(header) && self._readyState > 1 && jsTruthy(self._headers)) && !self._errorFlag {
|
|
476
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
484
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:295)
|
|
477
485
|
header = header.lowercased()
|
|
478
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
486
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:296)
|
|
479
487
|
for i in jsKeysOf(self._headers) {
|
|
480
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
488
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:297)
|
|
481
489
|
if jsStringEquals(i.lowercased(), header) {
|
|
482
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
490
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:298)
|
|
483
491
|
return try jsConvertedStringOrNil(jsGet(self._headers, i))
|
|
484
492
|
}
|
|
485
493
|
}
|
|
486
494
|
}
|
|
487
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
495
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:303)
|
|
488
496
|
return nil
|
|
489
497
|
}
|
|
490
498
|
#sourceLocation()
|
|
491
499
|
open func overrideMimeType(_ mime: String) throws {
|
|
492
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
500
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:307)
|
|
493
501
|
if jsLenientNumberEquals(self._readyState, self.LOADING) || jsLenientNumberEquals(self._readyState, self.DONE) {
|
|
494
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
502
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:308)
|
|
495
503
|
throw JSException(
|
|
496
504
|
value: JSError(
|
|
497
505
|
"Failed to execute 'overrideMimeType' on 'XMLHttpRequest': "
|
|
498
506
|
+ "MimeType cannot be overridden when the state is LOADING or DONE."))
|
|
499
507
|
}
|
|
500
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
508
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:311)
|
|
501
509
|
self._overrideMimeType = mime
|
|
502
510
|
}
|
|
503
511
|
#sourceLocation()
|
|
@@ -794,7 +802,7 @@ open class FormData: JSDynamic, JSStringConvertible, JSExpando, JSStaticKeyed {
|
|
|
794
802
|
nonisolated deinit {}
|
|
795
803
|
open var _data: JSMap<String, Any?>? = JSMap<String, Any?>()
|
|
796
804
|
public init() {
|
|
797
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
805
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:362)
|
|
798
806
|
self._data = JSMap<String, Any?>()
|
|
799
807
|
}
|
|
800
808
|
#sourceLocation()
|
|
@@ -807,19 +815,19 @@ open class FormData: JSDynamic, JSStringConvertible, JSExpando, JSStaticKeyed {
|
|
|
807
815
|
open var jsSymbolKeys: [String] { jsExpando?.jsSymbolKeys ?? [] }
|
|
808
816
|
open func jsDeleteOwn(_ key: String) -> Bool { jsExpando?.delete(key) ?? true }
|
|
809
817
|
open func append(_ name: String, _ value: Any?) throws {
|
|
810
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
818
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:366)
|
|
811
819
|
_ = try jsUnwrap(self._data, "set").set(name, value)
|
|
812
820
|
}
|
|
813
821
|
#sourceLocation()
|
|
814
822
|
open func toString() throws -> String {
|
|
815
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:368)
|
|
816
|
-
let arr: JSArray<String> = JSArray<String>()
|
|
817
823
|
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:370)
|
|
824
|
+
let arr: JSArray<String> = JSArray<String>()
|
|
825
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:372)
|
|
818
826
|
try jsUnwrap(self._data, "forEach").forEach { (value: Any?, name: String, map: JSMap<String, Any?>) -> Void in
|
|
819
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
827
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:373)
|
|
820
828
|
_ = arr.push("\(jsEncodeURIComponent(name))=\(jsEncodeURIComponent(jsToString(value)))")
|
|
821
829
|
}
|
|
822
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
830
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:376)
|
|
823
831
|
return arr.join("&")
|
|
824
832
|
}
|
|
825
833
|
#sourceLocation()
|
|
@@ -877,7 +885,7 @@ open class BlobInternalAccessor: JSDynamic, JSExpando, JSConstructibleType, JSSt
|
|
|
877
885
|
open var jsSymbolKeys: [String] { jsExpando?.jsSymbolKeys ?? [] }
|
|
878
886
|
open func jsDeleteOwn(_ key: String) -> Bool { jsExpando?.delete(key) ?? true }
|
|
879
887
|
open class func getBuffer(_ blob: Blob?) throws -> JSUint8Array? {
|
|
880
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
888
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:383)
|
|
881
889
|
return try jsUnwrap(blob, "_buffer")._buffer
|
|
882
890
|
}
|
|
883
891
|
#sourceLocation()
|
|
@@ -904,41 +912,34 @@ open class Blob: JSDynamic, JSStringConvertible, JSToStringTag, JSExpando, JSKey
|
|
|
904
912
|
open var _type: String = ""
|
|
905
913
|
open var jsToStringTag: String = "Blob"
|
|
906
914
|
public init(_ chunks: JSArray<Any?>? = nil, _ opts: Any? = nil) throws {
|
|
907
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
915
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:401)
|
|
908
916
|
let chunks: JSArray<Any?> = chunks ?? JSArray<Any?>()
|
|
909
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
917
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:401)
|
|
910
918
|
let opts: Any? = opts ?? JSObject([])
|
|
911
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
919
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:402)
|
|
912
920
|
let dataChunks: JSArray<JSUint8Array> = JSArray<JSUint8Array>()
|
|
913
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
921
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:403)
|
|
914
922
|
for chunk in try jsIterated(chunks, "chunks is not iterable") {
|
|
915
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
923
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:404)
|
|
916
924
|
if chunk is Blob {
|
|
917
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
925
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:405)
|
|
918
926
|
_ = try dataChunks.push(
|
|
919
927
|
jsObjectRequired(jsUnwrap(jsShaped(chunk) { try NativeScriptKit.Blob() }, "_buffer")._buffer))
|
|
920
928
|
} else if jsStringEquals(jsTypeof(chunk), "string") {
|
|
921
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
929
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:407)
|
|
922
930
|
let textEncoder: JSTextEncoder = JSTextEncoder()
|
|
923
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:406)
|
|
924
|
-
_ = try dataChunks.push(jsObjectRequired(textEncoder.encode(jsLenientString(chunk))))
|
|
925
|
-
} else if chunk is JSDataView {
|
|
926
931
|
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:408)
|
|
927
|
-
_ = try dataChunks.push(
|
|
928
|
-
|
|
929
|
-
)
|
|
930
|
-
} else if (chunk is JSArrayBuffer) || JSArrayBuffer.isView((chunk as? JSArrayBufferView)) {
|
|
932
|
+
_ = try dataChunks.push(jsObjectRequired(textEncoder.encode(jsLenientString(chunk))))
|
|
933
|
+
} else if (chunk is JSArrayBuffer) || JSArrayBuffer.isView(chunk) {
|
|
931
934
|
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:410)
|
|
932
935
|
_ = try dataChunks.push(
|
|
933
|
-
JSUint8Array(
|
|
934
|
-
|
|
935
|
-
(
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
).slice(0)) : jsObjectRequired(jsUnwrap(chunk as? JSArrayBuffer, "slice").slice(0)))
|
|
941
|
-
)))
|
|
936
|
+
JSUint8Array.from(
|
|
937
|
+
(JSArrayBuffer.isView(chunk)
|
|
938
|
+
? jsCallMethod(
|
|
939
|
+
jsGet(chunk, "buffer"), "slice", jsGet(chunk, "byteOffset"),
|
|
940
|
+
jsConvertedNumber(jsGet(chunk, "byteOffset"))
|
|
941
|
+
+ jsConvertedNumber(jsGet(chunk, "byteLength")))
|
|
942
|
+
: (jsObjectRequired(jsUnwrap(chunk as? JSArrayBuffer, "slice").slice(0)) as Any?))))
|
|
942
943
|
} else {
|
|
943
944
|
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:412)
|
|
944
945
|
let textEncoder: JSTextEncoder = JSTextEncoder()
|
|
@@ -988,12 +989,12 @@ open class Blob: JSDynamic, JSStringConvertible, JSToStringTag, JSExpando, JSKey
|
|
|
988
989
|
}
|
|
989
990
|
#sourceLocation()
|
|
990
991
|
open var size: Double {
|
|
991
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
992
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:395)
|
|
992
993
|
return self._size
|
|
993
994
|
}
|
|
994
995
|
#sourceLocation()
|
|
995
996
|
open var type: String {
|
|
996
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
997
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:398)
|
|
997
998
|
return self._type
|
|
998
999
|
}
|
|
999
1000
|
#sourceLocation()
|
|
@@ -1671,7 +1672,7 @@ public func __init_Core_xhr_index() {
|
|
|
1671
1672
|
guard let __o = __this as? XMLHttpRequest else { throw JSException(JSTypeError("Illegal invocation")) }
|
|
1672
1673
|
return __o.statusText
|
|
1673
1674
|
}, set: nil)
|
|
1674
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
1675
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:381)
|
|
1675
1676
|
JSPrototypes.declareStatics(
|
|
1676
1677
|
BlobInternalAccessor.self,
|
|
1677
1678
|
[
|
|
@@ -1682,7 +1683,7 @@ public func __init_Core_xhr_index() {
|
|
|
1682
1683
|
}
|
|
1683
1684
|
)
|
|
1684
1685
|
])
|
|
1685
|
-
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:
|
|
1686
|
+
#sourceLocation(file:"@nativescript/core/xhr.index.ts",line:387)
|
|
1686
1687
|
JSPrototypes.declare(
|
|
1687
1688
|
Blob.self, "size",
|
|
1688
1689
|
get: { (__this: Any?) throws -> Any? in
|
|
@@ -1267,6 +1267,10 @@ extension JSArray: JSArrayViewing {
|
|
|
1267
1267
|
static func jsViewing(_ source: JSArrayProtocol) -> AnyObject { source.jsView(as: Element.self) }
|
|
1268
1268
|
}
|
|
1269
1269
|
|
|
1270
|
+
extension Optional: JSArrayViewing where Wrapped: JSArrayViewing {
|
|
1271
|
+
static func jsViewing(_ source: JSArrayProtocol) -> AnyObject { Wrapped.jsViewing(source) }
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1270
1274
|
/// An array type an array of another element type, whose elements it can hold, becomes, keeping that array as its view.
|
|
1271
1275
|
protocol JSArrayAdopting {
|
|
1272
1276
|
static func jsAdopt(_ plain: JSArrayAdoptable) -> AnyObject?
|
|
@@ -252,6 +252,7 @@ public func jsDefineProperty(_ object: Any?, _ key: String, _ descriptor: Any?)
|
|
|
252
252
|
|
|
253
253
|
/// An object of a program class whose declared fields `Object.defineProperty` may give a descriptor (an accessor, read-only,
|
|
254
254
|
/// hidden): such a field's reads and writes go through `subscript(jsKey:)`, which defers to the descriptor kept beside the object.
|
|
255
|
+
@MainActor
|
|
255
256
|
public protocol JSDefinable: JSDynamic {
|
|
256
257
|
func jsDefinable(_ key: String) -> Bool
|
|
257
258
|
}
|
|
@@ -399,6 +400,7 @@ public func jsObjectFromEntries<S: Sequence>(_ entries: S) throws -> JSRecord<An
|
|
|
399
400
|
}
|
|
400
401
|
|
|
401
402
|
/// An object that can lose an own property (`delete o.x`).
|
|
403
|
+
@MainActor
|
|
402
404
|
public protocol JSDeletable: AnyObject {
|
|
403
405
|
func jsDeleteOwn(_ key: String) -> Bool
|
|
404
406
|
}
|
|
@@ -27,7 +27,7 @@ public final class InteropReference {
|
|
|
27
27
|
}
|
|
28
28
|
/// A Core Foundation error out-parameter: what the function writes is owned by the caller, and held as an NSError.
|
|
29
29
|
public var cfError: Unmanaged<CFError>? {
|
|
30
|
-
get { (value as? NSError).map { Unmanaged.passUnretained($0
|
|
30
|
+
get { (value as? NSError).map { Unmanaged.passUnretained(unsafeBitCast($0, to: CFError.self)) } }
|
|
31
31
|
set { value = newValue.map { $0.takeRetainedValue() as Error as NSError } }
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -696,7 +696,7 @@ public final class JSDateTimeFormat: JSDynamic {
|
|
|
696
696
|
}
|
|
697
697
|
|
|
698
698
|
private func zoneName(_ date: Date, long: Bool) -> String {
|
|
699
|
-
if timeZoneId == "UTC" { return long ? "Coordinated Universal Time" : "UTC" }
|
|
699
|
+
if timeZoneId == "UTC" || timeZoneId == "GMT" || timeZoneId == "Etc/UTC" { return long ? "Coordinated Universal Time" : "UTC" }
|
|
700
700
|
// ICU's zone names start in 1970; before, a zone is its offset from GMT.
|
|
701
701
|
if date.timeIntervalSince1970 < 0 { return offsetName(date, long: long) }
|
|
702
702
|
if long {
|
|
@@ -646,7 +646,7 @@ public func jsAsyncIteratorOf(_ value: Any?) throws -> JSAsyncIterator<Any?> {
|
|
|
646
646
|
}
|
|
647
647
|
|
|
648
648
|
/// AsyncIteratorClose for `for await` leaving early: awaits `return()` when the iterator has one.
|
|
649
|
-
public func jsAsyncClose(_ iterator: JSAsyncIteratorProtocol, _ then: @escaping () -> Void, _ onError: @escaping (Any?) -> Void) {
|
|
649
|
+
public func jsAsyncClose(_ iterator: JSAsyncIteratorProtocol, _ then: @escaping @MainActor () -> Void, _ onError: @escaping (Any?) -> Void) {
|
|
650
650
|
guard let promise = iterator.jsReturnPromise(nil) else { return then() }
|
|
651
651
|
jsAwait(promise, { result in
|
|
652
652
|
guard let object = jsFlat(result), jsIsObject(object), !(object is JSNull) else { return onError(JSTypeError("Iterator result \(jsToString(result)) is not an object")) }
|