-
Notifications
You must be signed in to change notification settings - Fork 30k
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 <[email protected]> Reviewed-By: Debadree Chatterjee <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
1 parent
1aab22e
commit eee9db8
Showing
7 changed files
with
137 additions
and
5 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