@nstudio/nativescript-compiler 9.2.0-alpha.10 → 9.2.0-alpha.12
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/dist/api/ir.js +7 -1
- package/dist/cli/runtime.cjs +7 -1
- package/dist/css/css.js +30 -6
- package/dist/driver/cli.js +2 -0
- package/dist/driver/compile.js +23 -10
- package/dist/driver/paths.js +7 -0
- package/dist/driver/unimplemented.js +15 -0
- package/dist/kotlin/access.js +23 -5
- package/dist/kotlin/arguments.js +5 -0
- package/dist/kotlin/builtins.js +0 -4
- package/dist/kotlin/calls.js +6 -2
- package/dist/kotlin/class-methods.js +9 -3
- package/dist/kotlin/components.js +13 -8
- package/dist/kotlin/conversion.js +17 -5
- package/dist/kotlin/core-api.js +2 -13
- package/dist/kotlin/declarations.js +2 -0
- package/dist/kotlin/expression-statements.js +5 -4
- package/dist/kotlin/expressions.js +8 -3
- package/dist/kotlin/functions.js +13 -4
- package/dist/kotlin/global-calls.js +11 -0
- package/dist/kotlin/literals.js +58 -14
- package/dist/kotlin/names.js +2 -2
- package/dist/kotlin/native/api.js +9 -1
- package/dist/kotlin/native/calls.js +84 -3
- package/dist/kotlin/native/subclasses.js +4 -3
- package/dist/kotlin/native/types.js +8 -5
- package/dist/kotlin/operators.js +4 -1
- package/dist/kotlin/overrides.js +7 -5
- package/dist/kotlin/placement.js +3 -1
- package/dist/kotlin/prototype-calls.js +5 -0
- package/dist/kotlin/render.js +62 -0
- package/dist/kotlin/statements.js +9 -0
- package/dist/kotlin/static-calls.js +10 -7
- package/dist/kotlin/translator.js +31 -11
- package/dist/kotlin/type-facts.js +10 -2
- package/dist/kotlin/types.js +6 -6
- package/dist/plugins/native-android.js +37 -5
- package/dist/plugins/native-ios.js +2 -0
- package/dist/plugins/source.js +73 -23
- package/dist/program/app-modules.js +91 -16
- package/dist/program/app-paths.js +80 -12
- package/dist/program/class-mixins.js +463 -0
- package/dist/program/core-facts.js +7 -0
- package/dist/program/glob.js +274 -0
- package/dist/program/platform.js +32 -4
- package/dist/program/program.js +239 -38
- package/dist/program/source-lines.js +4 -1
- package/dist/program/vite-plugins.js +144 -0
- package/dist/semantics/apis/globals.js +2 -2
- package/dist/semantics/apis/object.js +1 -0
- package/dist/semantics/apis/statics.js +6 -0
- package/dist/semantics/ast.js +20 -2
- package/dist/semantics/classes.js +36 -1
- package/dist/semantics/facts.js +28 -1
- package/dist/semantics/globals.js +3 -0
- package/dist/semantics/lang.js +13 -1
- package/dist/semantics/nullish.js +29 -11
- package/dist/semantics/refuse-receivers.js +3 -3
- package/dist/semantics/refuse-scope.js +2 -7
- package/dist/semantics/runtime.js +1 -0
- package/dist/semantics/shapes.js +21 -1
- package/dist/semantics/states/value-states.js +1 -1
- package/dist/semantics/throws.js +1 -0
- package/dist/semantics/translator-methods.js +1 -1
- package/dist/semantics/types.js +21 -1
- package/dist/swift/access.js +25 -10
- package/dist/swift/arguments.js +10 -2
- package/dist/swift/assignment.js +12 -1
- package/dist/swift/builtins.js +0 -4
- package/dist/swift/calls.js +6 -2
- package/dist/swift/class-methods.js +3 -3
- package/dist/swift/components.js +28 -8
- package/dist/swift/construction.js +4 -0
- package/dist/swift/conversion.js +1 -1
- package/dist/swift/core-api.js +9 -12
- package/dist/swift/from-any.js +2 -2
- package/dist/swift/functions.js +13 -2
- package/dist/swift/generics.js +5 -1
- package/dist/swift/global-calls.js +2 -0
- package/dist/swift/literals.js +57 -10
- package/dist/swift/modules.js +1 -1
- package/dist/swift/names.js +1 -1
- package/dist/swift/native/sdk-tables.js +52 -4
- package/dist/swift/native/sdk.js +9 -1
- package/dist/swift/operators.js +4 -1
- package/dist/swift/parameters.js +5 -2
- package/dist/swift/placement.js +44 -4
- package/dist/swift/prototype-calls.js +17 -2
- package/dist/swift/render.js +64 -0
- package/dist/swift/results.js +1 -1
- package/dist/swift/statements.js +9 -0
- package/dist/swift/static-calls.js +13 -6
- package/dist/swift/types.js +9 -9
- package/dist/targets/android/build.js +18 -12
- package/dist/targets/ios/build.js +11 -10
- package/dist/targets/ios/dependencies.js +12 -0
- package/dist/targets/resources.js +15 -1
- package/dist/template/plan.js +105 -8
- package/dist/types/adapter-api.d.ts +13 -0
- package/dist/types/ir.d.ts +47 -0
- package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +102 -7485
- package/kit-android/generated/kotlin/org/nativescript/kit/application_application.kt +4 -4
- package/kit-android/generated/kotlin/org/nativescript/kit/image_source_index.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_common.kt +7 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_index.kt +3 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +2 -4
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_index.kt +5 -6
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_common.kt +1 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_dialogs_index.kt +11 -6
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment_transitions.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_common.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_helper_for_android.kt +7 -5
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_index.kt +6 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_touch_manager.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_flexbox_layout_index.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_search_bar_index.kt +4 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_segmented_bar_index.kt +2 -2
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_formatted_string.kt +1 -3
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_index.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_fade_transition.kt +1 -1
- package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_flip_transition.kt +8 -8
- package/kit-android/generated/kotlin/org/nativescript/kit/utils_index.kt +1 -1
- package/kit-android/generated/source-lines.json +1 -1
- package/kit-android/gradlew.bat +94 -0
- package/kit-android/src/fromcore/kotlin/org/nativescript/kit/CoreBridge.kt +67 -1
- package/kit-android/src/main/kotlin/org/nativescript/kit/Signals.kt +15 -2
- package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Prototypes.kt +26 -0
- package/kit-apple/Overlays/xml-free/Core/ui.core.bindable.index.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +26 -161
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +9 -284
- package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +11 -7
- package/kit-apple/Sources/NativeScriptKit/Core/Object_callback_thisArg_once.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +7 -5
- package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +4 -2
- package/kit-apple/Sources/NativeScriptKit/Core/{Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_91b5f3.swift → Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_fa18e1.swift} +28 -103
- package/kit-apple/Sources/NativeScriptKit/Core/__Namespace.Utils.swift +17 -15
- package/kit-apple/Sources/NativeScriptKit/Core/application-settings.index.ios.swift +8 -8
- package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/color.color-common.swift +7 -7
- package/kit-apple/Sources/NativeScriptKit/Core/data.observable.index.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +2 -1
- package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +40 -246
- package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +1 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.index.ios.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.content-view.index.swift +8 -8
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.index.swift +4 -4
- 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 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.view-helper-common.swift +7 -7
- package/kit-apple/Sources/NativeScriptKit/Core/ui.core.weak-event-listener.index.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.index.ios.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.image.image-common.swift +2 -2
- package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.absolute-layout.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.dock-layout.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.grid-layout.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.stack-layout.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.wrap-layout.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +3 -3
- package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +10 -6
- package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +1 -1
- package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +4 -4
- package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +2 -1
- package/kit-apple/Sources/NativeScriptKit/Core/utils.common.swift +9 -9
- package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.index.ios.swift +10 -10
- package/kit-apple/Sources/NativeScriptKit/CoreBridge.swift +67 -1
- package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +4 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +25 -0
- package/kit-apple/Sources/NativeScriptKit/Runtime/RegExp.swift +6 -0
- package/kit-apple/Sources/NativeScriptKit/Signals.swift +20 -2
- package/package.json +2 -1
- package/kit-apple/Sources/NativeScriptKit/Core/Object_toString_charAt_charCodeAt_concat_indexOf_lastIndexOf_and_44_more_fc25df.swift +0 -481
|
@@ -3752,7 +3752,9 @@ public struct FunctionCell_ListViewBaseOpt_AnyOpt_to_AnyOpt {
|
|
|
3752
3752
|
{
|
|
3753
3753
|
jsBoxedFunction(Self(f: __f)) {
|
|
3754
3754
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
3755
|
-
return try __f(
|
|
3755
|
+
return try __f(
|
|
3756
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) }),
|
|
3757
|
+
jsArg(__a, 1))
|
|
3756
3758
|
}
|
|
3757
3759
|
}
|
|
3758
3760
|
}
|
|
@@ -4010,7 +4012,9 @@ public struct FunctionCell_SegmentedBarBaseOpt_Double_to_Double {
|
|
|
4010
4012
|
jsBoxedFunction(Self(f: __f)) {
|
|
4011
4013
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4012
4014
|
return try __f(
|
|
4013
|
-
(
|
|
4015
|
+
jsUnlessNullish(
|
|
4016
|
+
jsArg(__a, 0), { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) }),
|
|
4017
|
+
(try jsConvertedNumber(jsArg(__a, 1))))
|
|
4014
4018
|
}
|
|
4015
4019
|
}
|
|
4016
4020
|
}
|
|
@@ -4195,7 +4199,9 @@ public struct FunctionCell_TabViewBaseOpt_Double_to_Double {
|
|
|
4195
4199
|
{
|
|
4196
4200
|
jsBoxedFunction(Self(f: __f)) {
|
|
4197
4201
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4198
|
-
return try __f(
|
|
4202
|
+
return try __f(
|
|
4203
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? TabViewBase) ?? TabViewBase(jsObject: $0) }),
|
|
4204
|
+
(try jsConvertedNumber(jsArg(__a, 1))))
|
|
4199
4205
|
}
|
|
4200
4206
|
}
|
|
4201
4207
|
}
|
|
@@ -4430,284 +4436,3 @@ public struct FunctionCell_to_Void_ViewOpt_to_to_Void_Opt {
|
|
|
4430
4436
|
_ name: String, _ length: Int, _ __f: ((@escaping () throws -> Void, View?) throws -> (() throws -> Void)?)?
|
|
4431
4437
|
) -> JSFunctionObject? { if let __f { return script(name, length, __f) } else { return nil } }
|
|
4432
4438
|
}
|
|
4433
|
-
|
|
4434
|
-
public struct FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt {
|
|
4435
|
-
public let f: (Any?, JSArray<Any?>) throws -> Any?
|
|
4436
|
-
public static func implicit(_ value: ((Any?, JSArray<Any?>) throws -> Any?)?) -> (
|
|
4437
|
-
(Any?, JSArray<Any?>) throws -> Any?
|
|
4438
|
-
)? { value }
|
|
4439
|
-
public static func present(_ value: ((Any?, JSArray<Any?>) throws -> Any?)?) throws -> (Any?, JSArray<Any?>) throws
|
|
4440
|
-
-> Any?
|
|
4441
|
-
{
|
|
4442
|
-
guard let value else { throw jsNoObject() }
|
|
4443
|
-
return value
|
|
4444
|
-
}
|
|
4445
|
-
public static func fromScript(_ __f: Any?) -> (Any?, JSArray<Any?>) throws -> Any? {
|
|
4446
|
-
if let __t = jsFlat(__f) as? (Any?, JSRest<Any?>) throws -> Any? { return __t }
|
|
4447
|
-
let __i = JSFunctionAlias(of: __f)
|
|
4448
|
-
return jsIdentified(
|
|
4449
|
-
Self(f: { (__p0: Any?, __p1: JSArray<Any?>) throws -> Any? in
|
|
4450
|
-
return try withExtendedLifetime(__i) { () throws -> Any? in
|
|
4451
|
-
return try jsCall(__f, spread: [__p0] + __p1.storage.map { $0 as Any? })
|
|
4452
|
-
}
|
|
4453
|
-
}), __i
|
|
4454
|
-
).f
|
|
4455
|
-
}
|
|
4456
|
-
public static func fromScriptOrNil(_ __f: Any?) -> ((Any?, JSArray<Any?>) throws -> Any?)? {
|
|
4457
|
-
jsIsNullish(__f) ? nil : fromScript(__f)
|
|
4458
|
-
}
|
|
4459
|
-
public static func script(_ name: String, _ length: Int, _ __f: @escaping (Any?, JSArray<Any?>) throws -> Any?)
|
|
4460
|
-
-> JSFunctionObject
|
|
4461
|
-
{
|
|
4462
|
-
jsBoxedFunction(Self(f: __f)) {
|
|
4463
|
-
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4464
|
-
return try __f(jsArg(__a, 0), JSArray<Any?>(__a.dropFirst(1).map { $0 }))
|
|
4465
|
-
}
|
|
4466
|
-
}
|
|
4467
|
-
}
|
|
4468
|
-
public static func scriptOrNil(_ name: String, _ length: Int, _ __f: ((Any?, JSArray<Any?>) throws -> Any?)?)
|
|
4469
|
-
-> JSFunctionObject?
|
|
4470
|
-
{ if let __f { return script(name, length, __f) } else { return nil } }
|
|
4471
|
-
}
|
|
4472
|
-
|
|
4473
|
-
public struct FunctionCell_AnyOpt_String_to_String {
|
|
4474
|
-
public let f: (Any?, String) throws -> String
|
|
4475
|
-
public static func implicit(_ value: ((Any?, String) throws -> String)?) -> ((Any?, String) throws -> String)? {
|
|
4476
|
-
value
|
|
4477
|
-
}
|
|
4478
|
-
public static func present(_ value: ((Any?, String) throws -> String)?) throws -> (Any?, String) throws -> String {
|
|
4479
|
-
guard let value else { throw jsNoObject() }
|
|
4480
|
-
return value
|
|
4481
|
-
}
|
|
4482
|
-
public static func script(_ name: String, _ length: Int, _ __f: @escaping (Any?, String) throws -> String)
|
|
4483
|
-
-> JSFunctionObject
|
|
4484
|
-
{
|
|
4485
|
-
jsBoxedFunction(Self(f: __f)) {
|
|
4486
|
-
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4487
|
-
return try __f(jsArg(__a, 0), (try jsConvertedString(jsArg(__a, 1))))
|
|
4488
|
-
}
|
|
4489
|
-
}
|
|
4490
|
-
}
|
|
4491
|
-
public static func scriptOrNil(_ name: String, _ length: Int, _ __f: ((Any?, String) throws -> String)?)
|
|
4492
|
-
-> JSFunctionObject?
|
|
4493
|
-
{ if let __f { return script(name, length, __f) } else { return nil } }
|
|
4494
|
-
public static func fromScript(_ __f: Any?) -> (Any?, String) throws -> String {
|
|
4495
|
-
if let __t = jsFlat(__f) as? (Any?, String) throws -> String { return __t }
|
|
4496
|
-
let __i = JSFunctionAlias(of: __f)
|
|
4497
|
-
return jsIdentified(
|
|
4498
|
-
Self(f: { (__p0: Any?, __p1: String) throws -> String in
|
|
4499
|
-
return try withExtendedLifetime(__i) { () throws -> String in
|
|
4500
|
-
return (try jsConvertedString(try jsCall(__f, __p0, __p1)))
|
|
4501
|
-
}
|
|
4502
|
-
}), __i
|
|
4503
|
-
).f
|
|
4504
|
-
}
|
|
4505
|
-
public static func fromScriptOrNil(_ __f: Any?) -> ((Any?, String) throws -> String)? {
|
|
4506
|
-
jsIsNullish(__f) ? nil : fromScript(__f)
|
|
4507
|
-
}
|
|
4508
|
-
}
|
|
4509
|
-
|
|
4510
|
-
public struct FunctionCell_DoubleOpt_DoubleOpt_to_String {
|
|
4511
|
-
public let f: (Double?, Double?) throws -> String
|
|
4512
|
-
public static func implicit(_ value: ((Double?, Double?) throws -> String)?) -> (
|
|
4513
|
-
(Double?, Double?) throws -> String
|
|
4514
|
-
)? { value }
|
|
4515
|
-
public static func present(_ value: ((Double?, Double?) throws -> String)?) throws -> (Double?, Double?) throws ->
|
|
4516
|
-
String
|
|
4517
|
-
{
|
|
4518
|
-
guard let value else { throw jsNoObject() }
|
|
4519
|
-
return value
|
|
4520
|
-
}
|
|
4521
|
-
public static func script(_ name: String, _ length: Int, _ __f: @escaping (Double?, Double?) throws -> String)
|
|
4522
|
-
-> JSFunctionObject
|
|
4523
|
-
{
|
|
4524
|
-
jsBoxedFunction(Self(f: __f)) {
|
|
4525
|
-
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4526
|
-
return try __f((try jsConvertedNumberOrNil(jsArg(__a, 0))), (try jsConvertedNumberOrNil(jsArg(__a, 1))))
|
|
4527
|
-
}
|
|
4528
|
-
}
|
|
4529
|
-
}
|
|
4530
|
-
public static func scriptOrNil(_ name: String, _ length: Int, _ __f: ((Double?, Double?) throws -> String)?)
|
|
4531
|
-
-> JSFunctionObject?
|
|
4532
|
-
{ if let __f { return script(name, length, __f) } else { return nil } }
|
|
4533
|
-
public static func fromScript(_ __f: Any?) -> (Double?, Double?) throws -> String {
|
|
4534
|
-
if let __t = jsFlat(__f) as? (Double?, Double?) throws -> String { return __t }
|
|
4535
|
-
let __i = JSFunctionAlias(of: __f)
|
|
4536
|
-
return jsIdentified(
|
|
4537
|
-
Self(f: { (__p0: Double?, __p1: Double?) throws -> String in
|
|
4538
|
-
return try withExtendedLifetime(__i) { () throws -> String in
|
|
4539
|
-
return (try jsConvertedString(try jsCall(__f, __p0, __p1)))
|
|
4540
|
-
}
|
|
4541
|
-
}), __i
|
|
4542
|
-
).f
|
|
4543
|
-
}
|
|
4544
|
-
public static func fromScriptOrNil(_ __f: Any?) -> ((Double?, Double?) throws -> String)? {
|
|
4545
|
-
jsIsNullish(__f) ? nil : fromScript(__f)
|
|
4546
|
-
}
|
|
4547
|
-
}
|
|
4548
|
-
|
|
4549
|
-
public struct FunctionCell_AnyOpt_DoubleOpt_to_JSArray_String_Opt {
|
|
4550
|
-
public let f: (Any?, Double?) throws -> JSArray<String>?
|
|
4551
|
-
public static func implicit(_ value: ((Any?, Double?) throws -> JSArray<String>?)?) -> (
|
|
4552
|
-
(Any?, Double?) throws -> JSArray<String>?
|
|
4553
|
-
)? { value }
|
|
4554
|
-
public static func present(_ value: ((Any?, Double?) throws -> JSArray<String>?)?) throws -> (Any?, Double?) throws
|
|
4555
|
-
-> JSArray<String>?
|
|
4556
|
-
{
|
|
4557
|
-
guard let value else { throw jsNoObject() }
|
|
4558
|
-
return value
|
|
4559
|
-
}
|
|
4560
|
-
public static func script(
|
|
4561
|
-
_ name: String, _ length: Int, _ __f: @escaping (Any?, Double?) throws -> JSArray<String>?
|
|
4562
|
-
) -> JSFunctionObject {
|
|
4563
|
-
jsBoxedFunction(Self(f: __f)) {
|
|
4564
|
-
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4565
|
-
return try __f(jsArg(__a, 0), (try jsConvertedNumberOrNil(jsArg(__a, 1))))
|
|
4566
|
-
}
|
|
4567
|
-
}
|
|
4568
|
-
}
|
|
4569
|
-
public static func scriptOrNil(_ name: String, _ length: Int, _ __f: ((Any?, Double?) throws -> JSArray<String>?)?)
|
|
4570
|
-
-> JSFunctionObject?
|
|
4571
|
-
{ if let __f { return script(name, length, __f) } else { return nil } }
|
|
4572
|
-
}
|
|
4573
|
-
|
|
4574
|
-
public struct FunctionCell_Double_DoubleOpt_to_String {
|
|
4575
|
-
public let f: (Double, Double?) throws -> String
|
|
4576
|
-
public static func implicit(_ value: ((Double, Double?) throws -> String)?) -> ((Double, Double?) throws -> String)?
|
|
4577
|
-
{ value }
|
|
4578
|
-
public static func present(_ value: ((Double, Double?) throws -> String)?) throws -> (Double, Double?) throws ->
|
|
4579
|
-
String
|
|
4580
|
-
{
|
|
4581
|
-
guard let value else { throw jsNoObject() }
|
|
4582
|
-
return value
|
|
4583
|
-
}
|
|
4584
|
-
public static func script(_ name: String, _ length: Int, _ __f: @escaping (Double, Double?) throws -> String)
|
|
4585
|
-
-> JSFunctionObject
|
|
4586
|
-
{
|
|
4587
|
-
jsBoxedFunction(Self(f: __f)) {
|
|
4588
|
-
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4589
|
-
return try __f((try jsConvertedNumber(jsArg(__a, 0))), (try jsConvertedNumberOrNil(jsArg(__a, 1))))
|
|
4590
|
-
}
|
|
4591
|
-
}
|
|
4592
|
-
}
|
|
4593
|
-
public static func scriptOrNil(_ name: String, _ length: Int, _ __f: ((Double, Double?) throws -> String)?)
|
|
4594
|
-
-> JSFunctionObject?
|
|
4595
|
-
{ if let __f { return script(name, length, __f) } else { return nil } }
|
|
4596
|
-
public static func fromScript(_ __f: Any?) -> (Double, Double?) throws -> String {
|
|
4597
|
-
if let __t = jsFlat(__f) as? (Double, Double?) throws -> String { return __t }
|
|
4598
|
-
let __i = JSFunctionAlias(of: __f)
|
|
4599
|
-
return jsIdentified(
|
|
4600
|
-
Self(f: { (__p0: Double, __p1: Double?) throws -> String in
|
|
4601
|
-
return try withExtendedLifetime(__i) { () throws -> String in
|
|
4602
|
-
return (try jsConvertedString(try jsCall(__f, __p0, __p1)))
|
|
4603
|
-
}
|
|
4604
|
-
}), __i
|
|
4605
|
-
).f
|
|
4606
|
-
}
|
|
4607
|
-
public static func fromScriptOrNil(_ __f: Any?) -> ((Double, Double?) throws -> String)? {
|
|
4608
|
-
jsIsNullish(__f) ? nil : fromScript(__f)
|
|
4609
|
-
}
|
|
4610
|
-
}
|
|
4611
|
-
|
|
4612
|
-
public struct FunctionCell_String_DoubleOpt_to_Bool {
|
|
4613
|
-
public let f: (String, Double?) throws -> Bool
|
|
4614
|
-
public static func implicit(_ value: ((String, Double?) throws -> Bool)?) -> ((String, Double?) throws -> Bool)? {
|
|
4615
|
-
value
|
|
4616
|
-
}
|
|
4617
|
-
public static func present(_ value: ((String, Double?) throws -> Bool)?) throws -> (String, Double?) throws -> Bool
|
|
4618
|
-
{
|
|
4619
|
-
guard let value else { throw jsNoObject() }
|
|
4620
|
-
return value
|
|
4621
|
-
}
|
|
4622
|
-
public static func script(_ name: String, _ length: Int, _ __f: @escaping (String, Double?) throws -> Bool)
|
|
4623
|
-
-> JSFunctionObject
|
|
4624
|
-
{
|
|
4625
|
-
jsBoxedFunction(Self(f: __f)) {
|
|
4626
|
-
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4627
|
-
return try __f((try jsConvertedString(jsArg(__a, 0))), (try jsConvertedNumberOrNil(jsArg(__a, 1))))
|
|
4628
|
-
}
|
|
4629
|
-
}
|
|
4630
|
-
}
|
|
4631
|
-
public static func scriptOrNil(_ name: String, _ length: Int, _ __f: ((String, Double?) throws -> Bool)?)
|
|
4632
|
-
-> JSFunctionObject?
|
|
4633
|
-
{ if let __f { return script(name, length, __f) } else { return nil } }
|
|
4634
|
-
public static func fromScript(_ __f: Any?) -> (String, Double?) throws -> Bool {
|
|
4635
|
-
if let __t = jsFlat(__f) as? (String, Double?) throws -> Bool { return __t }
|
|
4636
|
-
let __i = JSFunctionAlias(of: __f)
|
|
4637
|
-
return jsIdentified(
|
|
4638
|
-
Self(f: { (__p0: String, __p1: Double?) throws -> Bool in
|
|
4639
|
-
return try withExtendedLifetime(__i) { () throws -> Bool in
|
|
4640
|
-
return (try jsConvertedBool(try jsCall(__f, __p0, __p1)))
|
|
4641
|
-
}
|
|
4642
|
-
}), __i
|
|
4643
|
-
).f
|
|
4644
|
-
}
|
|
4645
|
-
public static func fromScriptOrNil(_ __f: Any?) -> ((String, Double?) throws -> Bool)? {
|
|
4646
|
-
jsIsNullish(__f) ? nil : fromScript(__f)
|
|
4647
|
-
}
|
|
4648
|
-
}
|
|
4649
|
-
|
|
4650
|
-
public struct FunctionCell_Double_StringOpt_to_String {
|
|
4651
|
-
public let f: (Double, String?) throws -> String
|
|
4652
|
-
public static func implicit(_ value: ((Double, String?) throws -> String)?) -> ((Double, String?) throws -> String)?
|
|
4653
|
-
{ value }
|
|
4654
|
-
public static func present(_ value: ((Double, String?) throws -> String)?) throws -> (Double, String?) throws ->
|
|
4655
|
-
String
|
|
4656
|
-
{
|
|
4657
|
-
guard let value else { throw jsNoObject() }
|
|
4658
|
-
return value
|
|
4659
|
-
}
|
|
4660
|
-
public static func script(_ name: String, _ length: Int, _ __f: @escaping (Double, String?) throws -> String)
|
|
4661
|
-
-> JSFunctionObject
|
|
4662
|
-
{
|
|
4663
|
-
jsBoxedFunction(Self(f: __f)) {
|
|
4664
|
-
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4665
|
-
return try __f((try jsConvertedNumber(jsArg(__a, 0))), (try jsConvertedStringOrNil(jsArg(__a, 1))))
|
|
4666
|
-
}
|
|
4667
|
-
}
|
|
4668
|
-
}
|
|
4669
|
-
public static func scriptOrNil(_ name: String, _ length: Int, _ __f: ((Double, String?) throws -> String)?)
|
|
4670
|
-
-> JSFunctionObject?
|
|
4671
|
-
{ if let __f { return script(name, length, __f) } else { return nil } }
|
|
4672
|
-
public static func fromScript(_ __f: Any?) -> (Double, String?) throws -> String {
|
|
4673
|
-
if let __t = jsFlat(__f) as? (Double, String?) throws -> String { return __t }
|
|
4674
|
-
let __i = JSFunctionAlias(of: __f)
|
|
4675
|
-
return jsIdentified(
|
|
4676
|
-
Self(f: { (__p0: Double, __p1: String?) throws -> String in
|
|
4677
|
-
return try withExtendedLifetime(__i) { () throws -> String in
|
|
4678
|
-
return (try jsConvertedString(try jsCall(__f, __p0, __p1)))
|
|
4679
|
-
}
|
|
4680
|
-
}), __i
|
|
4681
|
-
).f
|
|
4682
|
-
}
|
|
4683
|
-
public static func fromScriptOrNil(_ __f: Any?) -> ((Double, String?) throws -> String)? {
|
|
4684
|
-
jsIsNullish(__f) ? nil : fromScript(__f)
|
|
4685
|
-
}
|
|
4686
|
-
}
|
|
4687
|
-
|
|
4688
|
-
public struct FunctionCell_AnyOpt_DoubleOpt_to_JSArray_String {
|
|
4689
|
-
public let f: (Any?, Double?) throws -> JSArray<String>
|
|
4690
|
-
public static func implicit(_ value: ((Any?, Double?) throws -> JSArray<String>)?) -> (
|
|
4691
|
-
(Any?, Double?) throws -> JSArray<String>
|
|
4692
|
-
)? { value }
|
|
4693
|
-
public static func present(_ value: ((Any?, Double?) throws -> JSArray<String>)?) throws -> (Any?, Double?) throws
|
|
4694
|
-
-> JSArray<String>
|
|
4695
|
-
{
|
|
4696
|
-
guard let value else { throw jsNoObject() }
|
|
4697
|
-
return value
|
|
4698
|
-
}
|
|
4699
|
-
public static func fromScript(_ __f: Any?) -> (Any?, Double?) throws -> JSArray<String> {
|
|
4700
|
-
if let __t = jsFlat(__f) as? (Any?, Double?) throws -> JSArray<String> { return __t }
|
|
4701
|
-
let __i = JSFunctionAlias(of: __f)
|
|
4702
|
-
return jsIdentified(
|
|
4703
|
-
Self(f: { (__p0: Any?, __p1: Double?) throws -> JSArray<String> in
|
|
4704
|
-
return try withExtendedLifetime(__i) { () throws -> JSArray<String> in
|
|
4705
|
-
return try jsObjectRequired(jsArrayOrNil(try jsCall(__f, __p0, __p1), { jsLenientString($0) }))
|
|
4706
|
-
}
|
|
4707
|
-
}), __i
|
|
4708
|
-
).f
|
|
4709
|
-
}
|
|
4710
|
-
public static func fromScriptOrNil(_ __f: Any?) -> ((Any?, Double?) throws -> JSArray<String>)? {
|
|
4711
|
-
jsIsNullish(__f) ? nil : fromScript(__f)
|
|
4712
|
-
}
|
|
4713
|
-
}
|
|
@@ -4320,7 +4320,9 @@ public struct FunctionCell_ListViewBaseOpt_AnyOpt_AnyOpt_to_Void {
|
|
|
4320
4320
|
) -> JSFunctionObject {
|
|
4321
4321
|
jsBoxedFunction(Self(f: __f)) {
|
|
4322
4322
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4323
|
-
try __f(
|
|
4323
|
+
try __f(
|
|
4324
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) }),
|
|
4325
|
+
jsArg(__a, 1), jsArg(__a, 2))
|
|
4324
4326
|
return nil
|
|
4325
4327
|
}
|
|
4326
4328
|
}
|
|
@@ -4611,8 +4613,9 @@ public struct FunctionCell_SegmentedBarBaseOpt_Double_Double_to_Void {
|
|
|
4611
4613
|
jsBoxedFunction(Self(f: __f)) {
|
|
4612
4614
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4613
4615
|
try __f(
|
|
4614
|
-
(
|
|
4615
|
-
|
|
4616
|
+
jsUnlessNullish(
|
|
4617
|
+
jsArg(__a, 0), { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) }),
|
|
4618
|
+
(try jsConvertedNumber(jsArg(__a, 1))), (try jsConvertedNumber(jsArg(__a, 2))))
|
|
4616
4619
|
return nil
|
|
4617
4620
|
}
|
|
4618
4621
|
}
|
|
@@ -4652,7 +4655,8 @@ public struct FunctionCell_SegmentedBarBaseOpt_JSArray_SegmentedBarItem_Opt_JSAr
|
|
|
4652
4655
|
jsBoxedFunction(Self(f: __f)) {
|
|
4653
4656
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4654
4657
|
try __f(
|
|
4655
|
-
(
|
|
4658
|
+
jsUnlessNullish(
|
|
4659
|
+
jsArg(__a, 0), { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) }),
|
|
4656
4660
|
try jsArrayOrNil(
|
|
4657
4661
|
jsArg(__a, 1), as: JSArray<SegmentedBarItem>.self,
|
|
4658
4662
|
{ try (jsCastPresent($0) as SegmentedBarItem) }),
|
|
@@ -4789,8 +4793,8 @@ public struct FunctionCell_TabViewBaseOpt_Double_Double_to_Void {
|
|
|
4789
4793
|
jsBoxedFunction(Self(f: __f)) {
|
|
4790
4794
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4791
4795
|
try __f(
|
|
4792
|
-
(
|
|
4793
|
-
(try jsConvertedNumber(jsArg(__a, 2))))
|
|
4796
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? TabViewBase) ?? TabViewBase(jsObject: $0) }),
|
|
4797
|
+
(try jsConvertedNumber(jsArg(__a, 1))), (try jsConvertedNumber(jsArg(__a, 2))))
|
|
4794
4798
|
return nil
|
|
4795
4799
|
}
|
|
4796
4800
|
}
|
|
@@ -4830,7 +4834,7 @@ public struct FunctionCell_TabViewBaseOpt_JSArray_TabViewItem_Opt_JSArray_TabVie
|
|
|
4830
4834
|
jsBoxedFunction(Self(f: __f)) {
|
|
4831
4835
|
jsFunction(name, length) { (__a: [Any?]) throws -> Any? in
|
|
4832
4836
|
try __f(
|
|
4833
|
-
(
|
|
4837
|
+
jsUnlessNullish(jsArg(__a, 0), { (jsFlat($0) as? TabViewBase) ?? TabViewBase(jsObject: $0) }),
|
|
4834
4838
|
try jsArrayOrNil(
|
|
4835
4839
|
jsArg(__a, 1), as: JSArray<TabViewItem>.self, { try (jsCastPresent($0) as TabViewItem) }),
|
|
4836
4840
|
try jsArrayOrNil(
|
|
@@ -73,7 +73,7 @@ public final class Object_callback_thisArg_once: JSDynamic, JSObjectConvertible
|
|
|
73
73
|
}
|
|
74
74
|
case 8:
|
|
75
75
|
switch key {
|
|
76
|
-
case "callback": return FunctionCell_EventDataOpt_to_Void.
|
|
76
|
+
case "callback": return FunctionCell_EventDataOpt_to_Void.scriptOrNil("", 1, self.callback)
|
|
77
77
|
default: break
|
|
78
78
|
}
|
|
79
79
|
default: break
|
|
@@ -43,10 +43,11 @@ public final class Object_eventName_object_index_section_view_ios_android: JSDyn
|
|
|
43
43
|
public convenience init(jsObject: Any?) {
|
|
44
44
|
self.init(
|
|
45
45
|
eventName: jsLenientString(jsField(jsObject, "eventName")),
|
|
46
|
-
object: (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
object: jsUnlessNullish(
|
|
47
|
+
jsField(jsObject, "object"), { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) }),
|
|
48
|
+
index: jsLenientNumber(jsField(jsObject, "index")), section: jsLenientNumber(jsField(jsObject, "section")),
|
|
49
|
+
view: (jsField(jsObject, "view") as? View), ios: jsField(jsObject, "ios"),
|
|
50
|
+
android: jsField(jsObject, "android"), jsOrder: (jsObject as? JSDynamic)?.jsKeys)
|
|
50
51
|
jsUnset = jsUnsetKeys(jsObject, ["ios", "android"])
|
|
51
52
|
jsExtra = jsObject as? JSDynamic
|
|
52
53
|
}
|
|
@@ -138,7 +139,8 @@ public final class Object_eventName_object_index_section_view_ios_android: JSDyn
|
|
|
138
139
|
case 6:
|
|
139
140
|
switch key {
|
|
140
141
|
case "object":
|
|
141
|
-
self.object = (
|
|
142
|
+
self.object = jsUnlessNullish(
|
|
143
|
+
newValue, { (jsFlat($0) as? ListViewBase) ?? ListViewBase(jsObject: $0) })
|
|
142
144
|
return
|
|
143
145
|
default: break
|
|
144
146
|
}
|
package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift
CHANGED
|
@@ -35,7 +35,8 @@ public final class Object_eventName_object_oldIndex_newIndex: JSDynamic, JSObjec
|
|
|
35
35
|
public convenience init(jsObject: Any?) {
|
|
36
36
|
self.init(
|
|
37
37
|
eventName: jsLenientString(jsField(jsObject, "eventName")),
|
|
38
|
-
object: (
|
|
38
|
+
object: jsUnlessNullish(
|
|
39
|
+
jsField(jsObject, "object"), { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) }),
|
|
39
40
|
oldIndex: jsLenientNumber(jsField(jsObject, "oldIndex")),
|
|
40
41
|
newIndex: jsLenientNumber(jsField(jsObject, "newIndex")), jsOrder: (jsObject as? JSDynamic)?.jsKeys)
|
|
41
42
|
jsExtra = jsObject as? JSDynamic
|
|
@@ -74,7 +75,8 @@ public final class Object_eventName_object_oldIndex_newIndex: JSDynamic, JSObjec
|
|
|
74
75
|
case 6:
|
|
75
76
|
switch key {
|
|
76
77
|
case "object":
|
|
77
|
-
self.object = (
|
|
78
|
+
self.object = jsUnlessNullish(
|
|
79
|
+
newValue, { (jsFlat($0) as? SegmentedBarBase) ?? SegmentedBarBase(jsObject: $0) })
|
|
78
80
|
return
|
|
79
81
|
default: break
|
|
80
82
|
}
|
|
@@ -15,12 +15,12 @@ import SystemConfiguration
|
|
|
15
15
|
import UIKit
|
|
16
16
|
import WebKit
|
|
17
17
|
|
|
18
|
-
public final class
|
|
19
|
-
JSToPrimitive
|
|
18
|
+
public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_fa18e1: JSDynamic,
|
|
19
|
+
JSToPrimitive
|
|
20
20
|
{
|
|
21
21
|
nonisolated deinit {}
|
|
22
22
|
public var iterator: JSSymbol
|
|
23
|
-
public var prototype: Any?
|
|
23
|
+
public var prototype: Any?
|
|
24
24
|
public var `for`: ((String) throws -> JSSymbol)?
|
|
25
25
|
public var keyFor: ((JSSymbol) throws -> String)?
|
|
26
26
|
public var hasInstance: JSSymbol
|
|
@@ -35,32 +35,26 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
|
|
|
35
35
|
public var unscopables: JSSymbol
|
|
36
36
|
public var asyncIterator: JSSymbol
|
|
37
37
|
public var matchAll: JSSymbol
|
|
38
|
-
public var apply:
|
|
39
|
-
public var call:
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
public var bind: ((Any?, JSRest<Any?>) throws -> Any?)? {
|
|
43
|
-
didSet { jsWrote("bind", oldValue != nil, self.bind == nil) }
|
|
44
|
-
}
|
|
38
|
+
public var apply: Any?
|
|
39
|
+
public var call: Any?
|
|
40
|
+
public var bind: Any?
|
|
45
41
|
public var toString: (() throws -> String)?
|
|
46
42
|
public var length: Double
|
|
47
|
-
public var arguments: Any?
|
|
48
|
-
public var caller: Any?
|
|
43
|
+
public var arguments: Any?
|
|
44
|
+
public var caller: Any?
|
|
49
45
|
public var name: String
|
|
50
|
-
public var
|
|
46
|
+
public var jsHasInstance: (Any?) throws -> Bool
|
|
51
47
|
public func jsToPrimitive(_ hint: String) throws -> Any? {
|
|
52
48
|
try jsOrdinaryToPrimitive(hint, valueOf: nil, toString: { try jsCallable(self.toString, "toString")() })
|
|
53
49
|
}
|
|
54
|
-
private
|
|
50
|
+
private let jsOrder: [String]?
|
|
55
51
|
public init(
|
|
56
52
|
iterator: JSSymbol, prototype: Any? = nil, `for`: ((String) throws -> JSSymbol)?,
|
|
57
53
|
keyFor: ((JSSymbol) throws -> String)?, hasInstance: JSSymbol, isConcatSpreadable: JSSymbol, match: JSSymbol,
|
|
58
54
|
replace: JSSymbol, search: JSSymbol, species: JSSymbol, split: JSSymbol, toPrimitive: JSSymbol,
|
|
59
|
-
toStringTag: JSSymbol, unscopables: JSSymbol, asyncIterator: JSSymbol, matchAll: JSSymbol,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
arguments: Any? = nil, caller: Any? = nil, name: String, ___hasInstance_257899473: ((Any?) throws -> Bool)?,
|
|
63
|
-
jsOrder: [String]? = nil, jsUnset: Set<String>? = nil
|
|
55
|
+
toStringTag: JSSymbol, unscopables: JSSymbol, asyncIterator: JSSymbol, matchAll: JSSymbol, apply: Any? = nil,
|
|
56
|
+
call: Any? = nil, bind: Any? = nil, toString: (() throws -> String)?, length: Double, arguments: Any? = nil,
|
|
57
|
+
caller: Any? = nil, name: String, jsHasInstance: @escaping (Any?) throws -> Bool, jsOrder: [String]? = nil
|
|
64
58
|
) {
|
|
65
59
|
self.iterator = iterator
|
|
66
60
|
self.prototype = prototype
|
|
@@ -86,72 +80,18 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
|
|
|
86
80
|
self.arguments = arguments
|
|
87
81
|
self.caller = caller
|
|
88
82
|
self.name = name
|
|
89
|
-
self.
|
|
83
|
+
self.jsHasInstance = jsHasInstance
|
|
90
84
|
self.jsOrder = jsOrder
|
|
91
|
-
self.jsUnset = jsUnset
|
|
92
85
|
}
|
|
93
86
|
private var jsExtra: JSDynamic?
|
|
94
|
-
public convenience init(jsObject: Any?) {
|
|
95
|
-
self.init(
|
|
96
|
-
iterator: (jsField(jsObject, "iterator") as! JSSymbol), prototype: jsField(jsObject, "prototype"),
|
|
97
|
-
for: FunctionCell_String_to_JSSymbol.fromScriptOrNil(jsField(jsObject, "for")),
|
|
98
|
-
keyFor: FunctionCell_JSSymbol_to_String.fromScriptOrNil(jsField(jsObject, "keyFor")),
|
|
99
|
-
hasInstance: (jsField(jsObject, "hasInstance") as! JSSymbol),
|
|
100
|
-
isConcatSpreadable: (jsField(jsObject, "isConcatSpreadable") as! JSSymbol),
|
|
101
|
-
match: (jsField(jsObject, "match") as! JSSymbol), replace: (jsField(jsObject, "replace") as! JSSymbol),
|
|
102
|
-
search: (jsField(jsObject, "search") as! JSSymbol), species: (jsField(jsObject, "species") as! JSSymbol),
|
|
103
|
-
split: (jsField(jsObject, "split") as! JSSymbol),
|
|
104
|
-
toPrimitive: (jsField(jsObject, "toPrimitive") as! JSSymbol),
|
|
105
|
-
toStringTag: (jsField(jsObject, "toStringTag") as! JSSymbol),
|
|
106
|
-
unscopables: (jsField(jsObject, "unscopables") as! JSSymbol),
|
|
107
|
-
asyncIterator: (jsField(jsObject, "asyncIterator") as! JSSymbol),
|
|
108
|
-
matchAll: (jsField(jsObject, "matchAll") as! JSSymbol),
|
|
109
|
-
apply: FunctionCell_AnyOpt_AnyOpt_to_AnyOpt.fromScriptOrNil(jsField(jsObject, "apply")),
|
|
110
|
-
call: FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt.fromScriptOrNil(jsField(jsObject, "call")),
|
|
111
|
-
bind: FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt.fromScriptOrNil(jsField(jsObject, "bind")),
|
|
112
|
-
toString: FunctionCell_none_to_String.fromScriptOrNil(jsField(jsObject, "toString")),
|
|
113
|
-
length: jsLenientNumber(jsField(jsObject, "length")), arguments: jsField(jsObject, "arguments"),
|
|
114
|
-
caller: jsField(jsObject, "caller"), name: jsLenientString(jsField(jsObject, "name")),
|
|
115
|
-
___hasInstance_257899473: FunctionCell_AnyOpt_to_Bool.fromScriptOrNil(
|
|
116
|
-
jsField(jsObject, "__@hasInstance@257899473")), jsOrder: (jsObject as? JSDynamic)?.jsKeys)
|
|
117
|
-
jsUnset = jsUnsetKeys(jsObject, ["prototype", "apply", "call", "bind", "arguments", "caller"])
|
|
118
|
-
jsExtra = jsObject as? JSDynamic
|
|
119
|
-
}
|
|
120
|
-
private var jsUnset: Set<String>?
|
|
121
|
-
private func jsHas(_ key: String) -> Bool {
|
|
122
|
-
switch key {
|
|
123
|
-
case "prototype": return self.prototype != nil || jsUnset?.contains("prototype") == true
|
|
124
|
-
case "apply": return self.apply != nil || jsUnset?.contains("apply") == true
|
|
125
|
-
case "call": return self.call != nil || jsUnset?.contains("call") == true
|
|
126
|
-
case "bind": return self.bind != nil || jsUnset?.contains("bind") == true
|
|
127
|
-
case "arguments": return self.arguments != nil || jsUnset?.contains("arguments") == true
|
|
128
|
-
case "caller": return self.caller != nil || jsUnset?.contains("caller") == true
|
|
129
|
-
default: return true
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
private func jsWrote(_ key: String, _ had: Bool, _ unset: Bool) {
|
|
133
|
-
let was = had || jsUnset?.contains(key) == true
|
|
134
|
-
if unset { jsUnset = (jsUnset ?? []).union([key]) } else { jsUnset?.remove(key) }
|
|
135
|
-
if !was {
|
|
136
|
-
jsOrder =
|
|
137
|
-
(jsOrder ?? [
|
|
138
|
-
"iterator", "prototype", "for", "keyFor", "hasInstance", "isConcatSpreadable", "match", "replace",
|
|
139
|
-
"search", "species", "split", "toPrimitive", "toStringTag", "unscopables", "asyncIterator",
|
|
140
|
-
"matchAll", "apply", "call", "bind", "toString", "length", "arguments", "caller", "name",
|
|
141
|
-
"__@hasInstance@257899473",
|
|
142
|
-
]).filter { $0 != key && jsHas($0) } + [key]
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
87
|
public var jsKeys: [String] {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
]
|
|
153
|
-
let keys = order + (jsExtra?.jsKeys ?? []).filter { !order.contains($0) }
|
|
154
|
-
return keys.filter(jsHas)
|
|
88
|
+
["iterator"] + (self.prototype == nil ? [] : ["prototype"]) + ["for"] + ["keyFor"] + ["hasInstance"] + [
|
|
89
|
+
"isConcatSpreadable"
|
|
90
|
+
] + ["match"] + ["replace"] + ["search"] + ["species"] + ["split"] + ["toPrimitive"] + ["toStringTag"] + [
|
|
91
|
+
"unscopables"
|
|
92
|
+
] + ["asyncIterator"] + ["matchAll"] + (self.apply == nil ? [] : ["apply"]) + (self.call == nil ? [] : ["call"])
|
|
93
|
+
+ (self.bind == nil ? [] : ["bind"]) + ["toString"] + ["length"]
|
|
94
|
+
+ (self.arguments == nil ? [] : ["arguments"]) + (self.caller == nil ? [] : ["caller"]) + ["name"]
|
|
155
95
|
}
|
|
156
96
|
public var jsClassName: String? { nil }
|
|
157
97
|
public subscript(jsKey key: String) -> Any? {
|
|
@@ -164,8 +104,8 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
|
|
|
164
104
|
}
|
|
165
105
|
case 4:
|
|
166
106
|
switch key {
|
|
167
|
-
case "call": return
|
|
168
|
-
case "bind": return
|
|
107
|
+
case "call": return self.call
|
|
108
|
+
case "bind": return self.bind
|
|
169
109
|
case "name": return self.name
|
|
170
110
|
default: break
|
|
171
111
|
}
|
|
@@ -173,7 +113,7 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
|
|
|
173
113
|
switch key {
|
|
174
114
|
case "match": return self.match
|
|
175
115
|
case "split": return self.split
|
|
176
|
-
case "apply": return
|
|
116
|
+
case "apply": return self.apply
|
|
177
117
|
default: break
|
|
178
118
|
}
|
|
179
119
|
case 6:
|
|
@@ -221,15 +161,9 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
|
|
|
221
161
|
case "isConcatSpreadable": return self.isConcatSpreadable
|
|
222
162
|
default: break
|
|
223
163
|
}
|
|
224
|
-
case 24:
|
|
225
|
-
switch key {
|
|
226
|
-
case "__@hasInstance@257899473":
|
|
227
|
-
return FunctionCell_AnyOpt_to_Bool.scriptOrNil("", 1, self.___hasInstance_257899473)
|
|
228
|
-
default: break
|
|
229
|
-
}
|
|
230
164
|
default: break
|
|
231
165
|
}
|
|
232
|
-
return
|
|
166
|
+
return nil
|
|
233
167
|
}
|
|
234
168
|
set {
|
|
235
169
|
switch key.utf8.count {
|
|
@@ -243,10 +177,10 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
|
|
|
243
177
|
case 4:
|
|
244
178
|
switch key {
|
|
245
179
|
case "call":
|
|
246
|
-
self.call =
|
|
180
|
+
self.call = newValue
|
|
247
181
|
return
|
|
248
182
|
case "bind":
|
|
249
|
-
self.bind =
|
|
183
|
+
self.bind = newValue
|
|
250
184
|
return
|
|
251
185
|
case "name":
|
|
252
186
|
jsStoring { self.name = (try jsConvertedString(newValue)) }
|
|
@@ -270,7 +204,7 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
|
|
|
270
204
|
}
|
|
271
205
|
return
|
|
272
206
|
case "apply":
|
|
273
|
-
self.apply =
|
|
207
|
+
self.apply = newValue
|
|
274
208
|
return
|
|
275
209
|
default: break
|
|
276
210
|
}
|
|
@@ -397,17 +331,8 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
|
|
|
397
331
|
return
|
|
398
332
|
default: break
|
|
399
333
|
}
|
|
400
|
-
case 24:
|
|
401
|
-
switch key {
|
|
402
|
-
case "__@hasInstance@257899473":
|
|
403
|
-
self.___hasInstance_257899473 = FunctionCell_AnyOpt_to_Bool.fromScriptOrNil(newValue)
|
|
404
|
-
return
|
|
405
|
-
default: break
|
|
406
|
-
}
|
|
407
334
|
default: break
|
|
408
335
|
}
|
|
409
|
-
if jsExtra == nil { jsExtra = JSObject() }
|
|
410
|
-
jsExtra?[jsKey: key] = newValue
|
|
411
336
|
}
|
|
412
337
|
}
|
|
413
338
|
}
|