Skip to content

Commit 59265e4

Browse files
committed
Fix #5175
1 parent 9fd4588 commit 59265e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/js/builtins/ConsoleObject.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
$overriddenName = "[Symbol.asyncIterator]";
22
export function asyncIterator(this: Console) {
3-
const Iterator = async function* ConsoleAsyncIterator() {
3+
const iterator = (async function* ConsoleAsyncIterator() {
44
const stream = Bun.stdin.stream();
55
var reader = stream.getReader();
66

@@ -57,11 +57,11 @@ export function asyncIterator(this: Console) {
5757
throw deferredError;
5858
}
5959
}
60-
};
60+
})();
6161

6262
const symbol = globalThis.Symbol.asyncIterator;
63-
this[symbol] = Iterator;
64-
return Iterator();
63+
this[symbol] = () => iterator;
64+
return iterator;
6565
}
6666

6767
export function write(this: Console, input) {

0 commit comments

Comments
 (0)