summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/stream/bug-1515816.js
blob: ccc1b70d10e79368c7f196fc97e7a85f43435a86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// |jit-test| --no-ion; --no-baseline; --no-blinterp; skip-if: !('oomAfterAllocations' in this)
// 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();
}