summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/stream/bug-1503399-1.js
blob: a5f7443279a6ca022395d2d4732043ec6e36dbba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// |jit-test| skip-if: !this.hasOwnProperty("ReadableStream")
// 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();");