mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-05-25 04:15:22 +00:00
pollyfill for webkit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user