@@ -1082,7 +1082,7 @@ export function emitWebIdl(
10821082
10831083 // Emit forEach for iterators
10841084 function emitIteratorForEach ( i : Browser . Interface ) {
1085- if ( ! i . iterator || i . iterator . async ) {
1085+ if ( ! i . iterator || i . iterator . kind === "async_iterable" ) {
10861086 return ;
10871087 }
10881088 const subtype = i . iterator . type . map ( convertDomTypeToTsType ) ;
@@ -1619,7 +1619,7 @@ export function emitWebIdl(
16191619
16201620 function emitSelfIterator ( i : Browser . Interface ) {
16211621 if ( ! compilerBehavior . useIteratorObject ) return ;
1622- const async = i . iterator ?. async ;
1622+ const async = i . iterator ?. kind === "async_iterable" ;
16231623 const name = getName ( i ) ;
16241624 const iteratorBaseType = `${ async ? "Async" : "" } IteratorObject` ;
16251625 const iteratorType = `${ name } ${ async ? "Async" : "" } Iterator` ;
@@ -1644,7 +1644,7 @@ export function emitWebIdl(
16441644 case "setlike" :
16451645 return ;
16461646 }
1647- const async = i . iterator ?. async ;
1647+ const async = i . iterator ?. kind === "async_iterable" ;
16481648 const iteratorType = async
16491649 ? ! compilerBehavior . useIteratorObject
16501650 ? "AsyncIterableIterator"
@@ -1659,7 +1659,10 @@ export function emitWebIdl(
16591659 name : `[Symbol.${ async ? "asyncIterator" : "iterator" } ]` ,
16601660 type : stringifySingleOrTupleTypes ( subtypes ) ,
16611661 } ) ;
1662- if ( i . iterator ?. kind === "iterable" ) {
1662+ if (
1663+ i . iterator ?. kind === "iterable" ||
1664+ i . iterator ?. kind === "async_iterable"
1665+ ) {
16631666 if ( subtypes . length === 2 ) {
16641667 const [ keyType , valueType ] = subtypes ;
16651668 methods . push (
@@ -1718,7 +1721,7 @@ export function emitWebIdl(
17181721 }
17191722
17201723 function getIteratorSubtypes ( ) {
1721- if ( i . iterator && ! i . iterator . async ) {
1724+ if ( i . iterator && i . iterator . kind !== "async_iterable" ) {
17221725 if ( i . iterator . type . length === 1 ) {
17231726 return [ convertDomTypeToTsType ( i . iterator . type [ 0 ] ) ] ;
17241727 }
@@ -1848,7 +1851,7 @@ export function emitWebIdl(
18481851
18491852 function emitAsyncIterator ( i : Browser . Interface ) {
18501853 function getAsyncIteratorSubtypes ( ) {
1851- if ( i . iterator && i . iterator . kind === "iterable" && i . iterator . async ) {
1854+ if ( i . iterator && i . iterator . kind === "async_iterable" ) {
18521855 if ( i . iterator . type . length === 1 ) {
18531856 return [ convertDomTypeToTsType ( i . iterator . type [ 0 ] ) ] ;
18541857 }
0 commit comments