Skip to content

Commit 4990199

Browse files
saschanazSkyBlack1225
authored andcommitted
Do not create a promise from an uncatchable exception
Differential Revision: https://phabricator.services.mozilla.com/D172654 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1821563 gecko-commit: 703562db4aa2be8ae07f1edc22a0a9ed3ed42dec gecko-reviewers: mgaudet
1 parent a83a903 commit 4990199

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html class="test-wait">
3+
<script id="workerScript" type="text/worker">
4+
// Blob will pass a huge Uint8Array object whose stringification will take long
5+
const encoder = new TextEncoderStream()
6+
const blob = new Blob([new ArrayBuffer(1338720)])
7+
const writable = new WritableStream()
8+
blob.stream().pipeThrough(encoder).pipeTo(writable)
9+
// Wait a bit for the piping to start
10+
Promise.resolve().then(() => postMessage('started'));
11+
</script>
12+
<script>
13+
const worker = new Worker(URL.createObjectURL(new Blob([
14+
document.getElementById("workerScript").textContent
15+
])))
16+
worker.onmessage = () => {
17+
worker.terminate();
18+
document.documentElement.classList.remove("test-wait");
19+
};
20+
</script>

0 commit comments

Comments
 (0)