summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/ReadableStream/bug-1501502.js
blob: e6b5c0c85ba2ae710ce98a84869bc42344561a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// |reftest| skip-if(!this.hasOwnProperty('ReadableStream'))
// A stream can become errored with an exception from another realm.

let g = newGlobal();
let g_enqueue;
new g.ReadableStream({
    start(controller) {
        g_enqueue = controller.enqueue;
    },
});

let controller;
let stream = new ReadableStream({
    start(c) {
        controller = c;
    }
}, {
    size(chunk) {}
});

assertThrowsInstanceOf(() => g_enqueue.call(controller, {}), g.RangeError);

if (typeof reportCompare == 'function')
    reportCompare(0, 0);