Skip to content

Commit 481f178

Browse files
committed
Iterator -> IterableIterator
1 parent 310f072 commit 481f178

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/quickjs-emscripten-core/src/QuickJSIterator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import type { QuickJSHandle } from "./types"
2828
*/
2929
export class QuickJSIterator
3030
extends UsingDisposable
31-
implements Disposable, Iterator<ContextResult<QuickJSHandle>>
31+
implements Disposable, IterableIterator<ContextResult<QuickJSHandle>>
3232
{
3333
public owner: QuickJSRuntime
3434
private _next: QuickJSHandle | undefined
@@ -42,6 +42,10 @@ export class QuickJSIterator
4242
this.owner = context.runtime
4343
}
4444

45+
[Symbol.iterator]() {
46+
return this
47+
}
48+
4549
next(value?: QuickJSHandle): IteratorResult<ContextResult<QuickJSHandle>, any> {
4650
if (!this.alive || this._isDone) {
4751
return {

0 commit comments

Comments
 (0)