@@ -566,6 +566,7 @@ public class JavaScriptEnvironment: ComponentBase {
566566 registerEnumeration ( OptionsBag . jsIntlSignDisplayEnum)
567567 registerEnumeration ( OptionsBag . jsIntlPluralRulesTypeEnum)
568568 registerEnumeration ( OptionsBag . jsIntlSegmenterGranularityEnum)
569+ registerEnumeration ( OptionsBag . jsIteratorZipModeEnum)
569570 registerEnumeration ( OptionsBag . base64Alphabet)
570571 registerEnumeration ( OptionsBag . base64LastChunkHandling)
571572
@@ -594,6 +595,7 @@ public class JavaScriptEnvironment: ComponentBase {
594595 registerOptionsBag ( . jsIntlRelativeTimeFormatSettings)
595596 registerOptionsBag ( . jsIntlSegmenterSettings)
596597 registerOptionsBag ( . jsIntlLocaleMatcherSettings)
598+ registerOptionsBag ( . jsIteratorZipSettings)
597599
598600 registerTemporalFieldsObject ( . jsTemporalPlainTimeLikeObject, forWith: false , dateFields: false , timeFields: true , zonedFields: false )
599601 registerTemporalFieldsObject ( . jsTemporalPlainDateLikeObject, forWith: false , dateFields: true , timeFields: false , zonedFields: false )
@@ -1072,7 +1074,7 @@ public struct OptionsBag {
10721074 self . properties = properties
10731075 let properties = properties. mapValues {
10741076 // This list can be expanded over time as long as createOptionsBag() supports this
1075- assert ( $0. isEnumeration || $0. Is ( . number | . integer | . boolean) ||
1077+ assert ( $0. isEnumeration || $0. Is ( . number | . integer | . boolean | . iterable ) ||
10761078 // Has a producing generator registered
10771079 $0. Is ( . jsTemporalPlainTime) ||
10781080 // Has explicit support in createOptionsBag
@@ -1122,7 +1124,7 @@ public extension ILType {
11221124 static let jsIterator = ILType . iterable + ILType. object ( ofGroup: " Iterator " , withProperties: [ " value " , " done " ] , withMethods: [ " next " , " return " , " throw " , " map " , " filter " , " take " , " drop " , " flatMap " , " reduce " , " toArray " , " forEach " , " some " , " every " , " find " ] )
11231125
11241126 /// Type of the JavaScript Iterator constructor builtin.
1125- static let jsIteratorConstructor = ILType . object ( ofGroup: " IteratorConstructor " , withProperties: [ " prototype " ] , withMethods: [ " from " , " concat " ] )
1127+ static let jsIteratorConstructor = ILType . object ( ofGroup: " IteratorConstructor " , withProperties: [ " prototype " ] , withMethods: [ " from " , " concat " , " zip " ] )
11261128
11271129 /// Type of a JavaScript generator object.
11281130 static let jsGenerator = ILType . iterable + ILType. object ( ofGroup: " Generator " , withMethods: [ " next " , " return " , " throw " ] )
@@ -1699,6 +1701,7 @@ public extension ObjectGroup {
16991701 methods: [
17001702 " from " : [ . jsAnything] => . jsIterator,
17011703 " concat " : [ . jsAnything... ] => . jsIterator,
1704+ " zip " : [ . iterable, . opt( OptionsBag . jsIteratorZipSettings. group. instanceType) ] => . jsIterator,
17021705 ]
17031706 )
17041707
@@ -4158,6 +4161,19 @@ extension OptionsBag {
41584161 )
41594162}
41604163
4164+ // Iterator
4165+ extension OptionsBag {
4166+ fileprivate static let jsIteratorZipModeEnum = ILType . enumeration ( ofName: " IteratorZipMode " , withValues: [ " strict " , " longest " , " shortest " ] )
4167+
4168+ static let jsIteratorZipSettings = OptionsBag (
4169+ name: " IteratorZipSettings " ,
4170+ properties: [
4171+ " mode " : jsIteratorZipModeEnum,
4172+ " padding " : . iterable,
4173+ ]
4174+ )
4175+ }
4176+
41614177// Base64
41624178extension OptionsBag {
41634179 fileprivate static let base64Alphabet =
0 commit comments