summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/stream/bug-1503399-1.js
blob: fb3cdac44feb6dbf564e36bd976ff01f173c8127 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Don't assert if the wrapper that's the value of stream.[[reader]] gets nuked.

load(libdir + "asserts.js");

ignoreUnhandledRejections();

let g = newGlobal({newCompartment: true});
let stream = new ReadableStream({
    start(controller) {
        controller.enqueue("ponies");
        controller.close();
    }
});
g.stream = stream;
g.eval("var reader = ReadableStream.prototype.getReader.call(stream);");
nukeCCW(g.reader);
assertErrorMessage(() => g.eval("reader.read()"), g.TypeError, "can't access dead object");
g.eval("reader.releaseLock();");