| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a20310d commit 2dc7956
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,6 +65,9 @@ const { | |||
| 65 | 65 | defaultReader.releaseLock(); | |
| 66 | 66 | const byobReader = r.getReader({ mode: 'byob' }); | |
| 67 | 67 | assert(byobReader instanceof ReadableStreamBYOBReader); | |
| 68 | + assert.match( | ||
| 69 | + inspect(byobReader, { depth: 0 }), | ||
| 70 | + /ReadableStreamBYOBReader/); | ||
| 68 | 71 | } | |
| 69 | 72 | ||
| 70 | 73 | class Source { | |
@@ -233,6 +236,19 @@ class Source { | |||
| 233 | 236 | }); | |
| 234 | 237 | } | |
| 235 | 238 | ||
| 239 | + { | ||
| 240 | + let controller; | ||
| 241 | + new ReadableStream({ | ||
| 242 | + type: 'bytes', | ||
| 243 | + start(c) { controller = c; } | ||
| 244 | + }); | ||
| 245 | + controller.enqueue(new Uint8Array(10)); | ||
| 246 | + controller.close(); | ||
| 247 | + assert.throws(() => controller.enqueue(new Uint8Array(10)), { | ||
| 248 | + code: 'ERR_INVALID_STATE', | ||
| 249 | + }); | ||
| 250 | + } | ||
| 251 | + | ||
| 236 | 252 | { | |
| 237 | 253 | const stream = new ReadableStream({ | |
| 238 | 254 | type: 'bytes', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,6 +32,7 @@ const { | |||
| 32 | 32 | readableStreamDefaultControllerCanCloseOrEnqueue, | |
| 33 | 33 | readableByteStreamControllerClose, | |
| 34 | 34 | readableByteStreamControllerRespond, | |
| 35 | + readableStreamReaderGenericRelease, | ||
| 35 | 36 | } = require('internal/webstreams/readablestream'); | |
| 36 | 37 | ||
| 37 | 38 | const { | |
@@ -371,6 +372,24 @@ assert.throws(() => { | |||
| 371 | 372 | }); | |
| 372 | 373 | } | |
| 373 | 374 | ||
| 375 | + { | ||
| 376 | + const stream = new ReadableStream(); | ||
| 377 | + const iterable = stream.values(); | ||
| 378 | + readableStreamReaderGenericRelease(stream[kState].reader); | ||
| 379 | + assert.rejects(iterable.next(), { | ||
| 380 | + code: 'ERR_INVALID_STATE', | ||
| 381 | + }).then(common.mustCall()); | ||
| 382 | + } | ||
| 383 | + | ||
| 384 | + { | ||
| 385 | + const stream = new ReadableStream(); | ||
| 386 | + const iterable = stream.values(); | ||
| 387 | + readableStreamReaderGenericRelease(stream[kState].reader); | ||
| 388 | + assert.rejects(iterable.return(), { | ||
| 389 | + code: 'ERR_INVALID_STATE', | ||
| 390 | + }).then(common.mustCall()); | ||
| 391 | + } | ||
| 392 | + | ||
| 374 | 393 | { | |
| 375 | 394 | const stream = new ReadableStream({ | |
| 376 | 395 | start(controller) { | |
@@ -1357,6 +1376,9 @@ class Source { | |||
| 1357 | 1376 | assert.throws(() => ReadableStream.prototype.tee.call({}), { | |
| 1358 | 1377 | code: 'ERR_INVALID_THIS', | |
| 1359 | 1378 | }); | |
| 1379 | + assert.throws(() => ReadableStream.prototype.values.call({}), { | ||
| 1380 | + code: 'ERR_INVALID_THIS', | ||
| 1381 | + }); | ||
| 1360 | 1382 | assert.throws(() => ReadableStream.prototype[kTransfer].call({}), { | |
| 1361 | 1383 | code: 'ERR_INVALID_THIS', | |
| 1362 | 1384 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments