Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /streams/readable-streams/crashtests/garbage-collection.any.html - WPT Dashboard Interop Dashboard
- /streams/readable-streams/crashtests/garbage-collection.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /streams/readable-streams/crashtests/garbage-collection.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /streams/readable-streams/crashtests/garbage-collection.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker
// META: script=/common/gc.js
'use strict';
promise_test(async () => {
let closed = new ReadableStream({
pull(controller) {
controller.enqueue('is there anybody in there?');
}
}).getReader().closed;
// 3 GCs are actually required to trigger the bug at time of writing.
for (let i = 0; i < 5; ++i)
await garbageCollect();
}, 'Garbage-collecting a stream along with its reader should not crash');