forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream: implement ReadableStream.from
Fixes: nodejs#48389
- Loading branch information
1 parent
8a725c7
commit ef12c54
Showing
14 changed files
with
1,036 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// META: global=window,worker | ||
'use strict'; | ||
|
||
promise_test(async t => { | ||
/** @type {ReadableStreamDefaultController} */ | ||
var con; | ||
let synchronous = false; | ||
new ReadableStream({ start(c) { con = c }}, { highWaterMark: 0 }).pipeTo( | ||
new WritableStream({ write() { synchronous = true; } }) | ||
) | ||
// wait until start algorithm finishes | ||
await Promise.resolve(); | ||
con.enqueue(); | ||
assert_false(synchronous, 'write algorithm must not run synchronously'); | ||
}, "enqueue() must not synchronously call write algorithm"); |
Oops, something went wrong.