Repository navigation
Commit 995dee6
stream: honor stream/iter protocols on function objects
The protocol lookup used by from(), fromSync(), and the
Broadcast/Share helpers only considered values with typeof 'object',
so a function implementing, e.g., Symbol.for('Stream.toStreamable') was
rejected with ERR_INVALID_ARG_TYPE. Functions are objects and the spec
does not exclude them; the iteration protocol checks already accept
them.
Assisted-by: OpenCode
Signed-off-by: James M Snell <[email protected]>
PR-URL: #66483
Reviewed-By: Trivikram Kamat <[email protected]>1 parent 6eaf913 commit 995dee6
3 files changed
Lines changed: 39 additions & 1 deletion
File tree
- lib/internal/streams/iter
- test/parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
380 | 383 | | |
381 | 384 | | |
382 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
510 | 532 | | |
511 | 533 | | |
512 | 534 | | |
513 | 535 | | |
514 | 536 | | |
515 | 537 | | |
| 538 | + | |
516 | 539 | | |
517 | 540 | | |
518 | 541 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
242 | 253 | | |
243 | 254 | | |
244 | 255 | | |
| |||
260 | 271 | | |
261 | 272 | | |
262 | 273 | | |
| 274 | + | |
263 | 275 | | |
0 commit comments