-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream: update ongoing promise in async iterator return() method
PR-URL: #52657 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
- Loading branch information
1 parent
4a3ecbf
commit 9b82b15
Showing
7 changed files
with
139 additions
and
7 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
14 changes: 14 additions & 0 deletions
14
test/fixtures/wpt/streams/piping/crashtests/cross-piping2.https.html
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,14 @@ | ||
<!DOCTYPE html> | ||
<script type="module"> | ||
let a = self.open() | ||
let d = await a.navigator.storage.getDirectory() | ||
let h = await d.getFileHandle("c5c9960b-a637-4232-be3d-3ccc5704852f", {"create": true}) | ||
let r = new ReadableStream({ | ||
start(c) { | ||
c.enqueue(h) | ||
c.close(); | ||
} | ||
}); | ||
let w = await h.createWritable({ }) | ||
r.pipeThrough({"readable": r, "writable": w}, {}) | ||
</script> |
21 changes: 21 additions & 0 deletions
21
test/fixtures/wpt/streams/piping/detached-context-crash.html
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,21 @@ | ||
<!DOCTYPE html> | ||
<body> | ||
<script> | ||
window.onload = () => { | ||
const i = document.createElement("iframe"); | ||
i.src = "about:blank"; | ||
document.body.appendChild(i); | ||
|
||
const rs = new i.contentWindow.ReadableStream({ | ||
start(controller) { controller.error(); } | ||
}); | ||
const ws = new i.contentWindow.WritableStream(); | ||
|
||
i.remove(); | ||
|
||
// pipeTo() should not crash with a ReadableStream or WritableStream from | ||
// a detached iframe. | ||
rs.pipeTo(ws); | ||
}; | ||
</script> | ||
</body> |
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
13 changes: 13 additions & 0 deletions
13
test/fixtures/wpt/streams/readable-streams/tee-detached-context-crash.html
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,13 @@ | ||
<!doctype html> | ||
<body> | ||
<script> | ||
const i = document.createElement("iframe"); | ||
document.body.appendChild(i); | ||
|
||
const rs = new i.contentWindow.ReadableStream(); | ||
i.remove(); | ||
|
||
// tee() on a ReadableStream from a detached iframe should not crash. | ||
rs.tee(); | ||
</script> | ||
</body> |
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