summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/stream/bug-1515816.js
blob: 6199eb9a3186954a5fced69a06b830cd68342f09 (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: !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();
}