diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/stream/bug-1515816.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/stream/bug-1515816.js b/js/src/jit-test/tests/stream/bug-1515816.js new file mode 100644 index 0000000000..44329b056d --- /dev/null +++ b/js/src/jit-test/tests/stream/bug-1515816.js @@ -0,0 +1,17 @@ +// |jit-test| --no-ion; --no-baseline; --no-blinterp; skip-if: !('oomAfterAllocations' in this && this.hasOwnProperty("ReadableStream")) +// Don't crash on OOM in ReadableStreamDefaultReader.prototype.read(). + +for (let n = 1; n < 1000; n++) { + let stream = new ReadableStream({ + start(controller) { + controller.enqueue(7); + } + }); + let reader = stream.getReader(); + oomAfterAllocations(n); + try { + reader.read(); + n = 1000; + } catch { } + resetOOMFailure(); +} |