| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2604,6 +2604,7 @@ function readableByteStreamControllerPullSteps(controller, readRequest) { | |||
| 2604 | 2604 | pendingPullIntos, | |
| 2605 | 2605 | { | |
| 2606 | 2606 | buffer, | |
| 2607 | + bufferByteLength: autoAllocateChunkSize, | ||
| 2607 | 2608 | byteOffset: 0, | |
| 2608 | 2609 | byteLength: autoAllocateChunkSize, | |
| 2609 | 2610 | bytesFilled: 0, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -232,3 +232,33 @@ class Source { | |||
| 232 | 232 | code: 'ERR_INVALID_STATE', | |
| 233 | 233 | }); | |
| 234 | 234 | } | |
| 235 | + | ||
| 236 | + { | ||
| 237 | + const stream = new ReadableStream({ | ||
| 238 | + type: 'bytes', | ||
| 239 | + pull(c) { | ||
| 240 | + const v = new Uint8Array(c.byobRequest.view.buffer, 0, 3); | ||
| 241 | + v.set([20, 21, 22]); | ||
| 242 | + c.byobRequest.respondWithNewView(v); | ||
| 243 | + }, | ||
| 244 | + }); | ||
| 245 | + const buffer = new ArrayBuffer(10); | ||
| 246 | + const view = new Uint8Array(buffer, 0, 3); | ||
| 247 | + view.set([10, 11, 12]); | ||
| 248 | + const reader = stream.getReader({ mode: 'byob' }); | ||
| 249 | + reader.read(view); | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + { | ||
| 253 | + const stream = new ReadableStream({ | ||
| 254 | + type: 'bytes', | ||
| 255 | + autoAllocateChunkSize: 10, | ||
| 256 | + pull(c) { | ||
| 257 | + const v = new Uint8Array(c.byobRequest.view.buffer, 0, 3); | ||
| 258 | + v.set([20, 21, 22]); | ||
| 259 | + c.byobRequest.respondWithNewView(v); | ||
| 260 | + }, | ||
| 261 | + }); | ||
| 262 | + const reader = stream.getReader(); | ||
| 263 | + reader.read(); | ||
| 264 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments