diff options
author | 2022-10-12 23:46:15 -0700 | |
---|---|---|
committer | 2022-10-12 23:46:15 -0700 | |
commit | 3fceae807037d97cd6c93d20d87d1ef5a98fdd75 (patch) | |
tree | 4c2f294fc53937f3e1646b9df73a4ec0265ef416 /src/bun.js/builtins/js/ReadableStream.js | |
parent | 8cd8e34719d45ccef3011de7431d066631a6c806 (diff) | |
download | bun-3fceae807037d97cd6c93d20d87d1ef5a98fdd75.tar.gz bun-3fceae807037d97cd6c93d20d87d1ef5a98fdd75.tar.zst bun-3fceae807037d97cd6c93d20d87d1ef5a98fdd75.zip |
Implement `ReadableStream.prototype[Symbol.asyncIterator]`
cc @fabiancook
Diffstat (limited to 'src/bun.js/builtins/js/ReadableStream.js')
-rw-r--r-- | src/bun.js/builtins/js/ReadableStream.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bun.js/builtins/js/ReadableStream.js b/src/bun.js/builtins/js/ReadableStream.js index 42c0fbdbc..8020b024d 100644 --- a/src/bun.js/builtins/js/ReadableStream.js +++ b/src/bun.js/builtins/js/ReadableStream.js @@ -443,3 +443,24 @@ function locked() return @isReadableStreamLocked(this); } + +function values(options) { + "use strict"; + var prototype = this?.constructor?.prototype; + if (!prototype) { + return @undefined; + } + @readableStreamDefineLazyIterators(prototype); + return prototype.values.@call(this, options); +} + +@linkTimeConstant +function lazyAsyncIterator() { + "use strict"; + var prototype = this?.constructor?.prototype; + if (!prototype) { + return @undefined; + } + @readableStreamDefineLazyIterators(prototype); + return prototype[globalThis.Symbol.asyncIterator].@call(this); +}
\ No newline at end of file |