Debian Codegraph @

testing/web-platform/tests/streams/readable-streams/constructor.any.js

raw
1 // META: global=window,worker,shadowrealm
2 'use strict';
3
4 const error1 = new Error('error1');
5 error1.name = 'error1';
6
7 const error2 = new Error('error2');
8 error2.name = 'error2';
9
10 test(() => {
11 const underlyingSource = { get start() { throw error1; } };
12 const queuingStrategy = { highWaterMark: 0, get size() { throw error2; } };
13
14 // underlyingSource is converted in prose in the method body, whereas queuingStrategy is done at the IDL layer.
15 // So the queuingStrategy exception should be encountered first.
16 assert_throws_exactly(error2, () => new ReadableStream(underlyingSource, queuingStrategy));
17 }, 'underlyingSource argument should be converted after queuingStrategy argument');