pollyfill for webkit

This commit is contained in:
MathMan05
2025-12-16 10:34:56 -06:00
parent b80e3dbfba
commit ffb8fecdb5
+9
View File
@@ -54,3 +54,12 @@ if ("Iterator" in globalThis) {
} else {
defineItter("".matchAll(/6/g).constructor as typeof Iterator);
}
ReadableStream.prototype[Symbol.asyncIterator] = async function* () {
const reader = this.getReader();
while (true) {
const v = await reader.read();
yield v.value;
if (v.done) return undefined;
}
};