tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

compression-constructor-error.any.js (563B)


      1 // META: global=window,worker,shadowrealm
      2 
      3 'use strict';
      4 
      5 test(t => {
      6  assert_throws_js(TypeError, () => new CompressionStream('a'), 'constructor should throw');
      7 }, '"a" should cause the constructor to throw');
      8 
      9 test(t => {
     10  assert_throws_js(TypeError, () => new CompressionStream(), 'constructor should throw');
     11 }, 'no input should cause the constructor to throw');
     12 
     13 test(t => {
     14  assert_throws_js(Error, () => new CompressionStream({ toString() { throw Error(); } }), 'constructor should throw');
     15 }, 'non-string input should cause the constructor to throw');