From 508bf92766d62125b8b2c7d558bde48e3dcf89bd Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Sun, 5 Sep 2021 00:20:30 +0200 Subject: [PATCH] Ignore async iterable declarations --- baselines/audioworklet.generated.d.ts | 1 - baselines/audioworklet.iterable.generated.d.ts | 7 ------- baselines/dom.generated.d.ts | 1 - baselines/dom.iterable.generated.d.ts | 7 ------- baselines/serviceworker.generated.d.ts | 1 - baselines/serviceworker.iterable.generated.d.ts | 7 ------- baselines/sharedworker.generated.d.ts | 1 - baselines/sharedworker.iterable.generated.d.ts | 7 ------- baselines/webworker.generated.d.ts | 1 - baselines/webworker.iterable.generated.d.ts | 7 ------- src/build/widlprocess.ts | 2 +- 11 files changed, 1 insertion(+), 41 deletions(-) diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 9c7d88968..6caeed220 100644 --- a/baselines/audioworklet.generated.d.ts +++ b/baselines/audioworklet.generated.d.ts @@ -301,7 +301,6 @@ interface ReadableStream { pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; tee(): [ReadableStream, ReadableStream]; - forEach(callbackfn: (value: any, key: number, parent: ReadableStream) => void, thisArg?: any): void; } declare var ReadableStream: { diff --git a/baselines/audioworklet.iterable.generated.d.ts b/baselines/audioworklet.iterable.generated.d.ts index c807fd845..265eb3b41 100644 --- a/baselines/audioworklet.iterable.generated.d.ts +++ b/baselines/audioworklet.iterable.generated.d.ts @@ -6,10 +6,3 @@ interface MessageEvent { /** @deprecated */ initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable): void; } - -interface ReadableStream { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[number, any]>; - keys(): IterableIterator; - values(): IterableIterator; -} diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index c7a0d2569..57c067429 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -10912,7 +10912,6 @@ interface ReadableStream { pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; tee(): [ReadableStream, ReadableStream]; - forEach(callbackfn: (value: any, key: number, parent: ReadableStream) => void, thisArg?: any): void; } declare var ReadableStream: { diff --git a/baselines/dom.iterable.generated.d.ts b/baselines/dom.iterable.generated.d.ts index b261d86b1..641a76a4f 100644 --- a/baselines/dom.iterable.generated.d.ts +++ b/baselines/dom.iterable.generated.d.ts @@ -170,13 +170,6 @@ interface PluginArray { interface RTCStatsReport extends ReadonlyMap { } -interface ReadableStream { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[number, any]>; - keys(): IterableIterator; - values(): IterableIterator; -} - interface SVGLengthList { [Symbol.iterator](): IterableIterator; } diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index 365345935..b61b819ab 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -2446,7 +2446,6 @@ interface ReadableStream { pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; tee(): [ReadableStream, ReadableStream]; - forEach(callbackfn: (value: any, key: number, parent: ReadableStream) => void, thisArg?: any): void; } declare var ReadableStream: { diff --git a/baselines/serviceworker.iterable.generated.d.ts b/baselines/serviceworker.iterable.generated.d.ts index 377f29c7f..0b3777d02 100644 --- a/baselines/serviceworker.iterable.generated.d.ts +++ b/baselines/serviceworker.iterable.generated.d.ts @@ -56,13 +56,6 @@ interface MessageEvent { initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable): void; } -interface ReadableStream { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[number, any]>; - keys(): IterableIterator; - values(): IterableIterator; -} - interface SubtleCrypto { deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable): Promise; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise; diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 52d9ee0dc..4f4a5bd7a 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -2332,7 +2332,6 @@ interface ReadableStream { pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; tee(): [ReadableStream, ReadableStream]; - forEach(callbackfn: (value: any, key: number, parent: ReadableStream) => void, thisArg?: any): void; } declare var ReadableStream: { diff --git a/baselines/sharedworker.iterable.generated.d.ts b/baselines/sharedworker.iterable.generated.d.ts index eca81f2c1..ba92c51d2 100644 --- a/baselines/sharedworker.iterable.generated.d.ts +++ b/baselines/sharedworker.iterable.generated.d.ts @@ -56,13 +56,6 @@ interface MessageEvent { initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable): void; } -interface ReadableStream { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[number, any]>; - keys(): IterableIterator; - values(): IterableIterator; -} - interface SubtleCrypto { deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable): Promise; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index e55e0ff8b..639cdf8be 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -2498,7 +2498,6 @@ interface ReadableStream { pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; tee(): [ReadableStream, ReadableStream]; - forEach(callbackfn: (value: any, key: number, parent: ReadableStream) => void, thisArg?: any): void; } declare var ReadableStream: { diff --git a/baselines/webworker.iterable.generated.d.ts b/baselines/webworker.iterable.generated.d.ts index 52d885453..11bc3bf38 100644 --- a/baselines/webworker.iterable.generated.d.ts +++ b/baselines/webworker.iterable.generated.d.ts @@ -56,13 +56,6 @@ interface MessageEvent { initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable): void; } -interface ReadableStream { - [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[number, any]>; - keys(): IterableIterator; - values(): IterableIterator; -} - interface SubtleCrypto { deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable): Promise; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise; diff --git a/src/build/widlprocess.ts b/src/build/widlprocess.ts index 3c8ac3ddb..ea0b03654 100644 --- a/src/build/widlprocess.ts +++ b/src/build/widlprocess.ts @@ -199,7 +199,7 @@ function convertInterfaceCommon( addComments(method[member.name], commentMap, i.name, member.name); } } else if ( - member.type === "iterable" || + (member.type === "iterable" && !member.async) || member.type === "maplike" || member.type === "setlike" ) {