tor-browser

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

origin-from.any.js (515B)


      1 // META: title=`Origin.from()`
      2 // META: script=resources/serializations.js
      3 
      4 //
      5 // Invalid Inputs: `null`, `undefined`, invalid URL strings, random objects.
      6 //
      7 const invalidInputs = [
      8  null,
      9  undefined,
     10  1,
     11  1.1,
     12  true,
     13  {},
     14  Object,
     15  Origin,
     16  Origin.from,
     17 ];
     18 
     19 for (const invalid of invalidInputs) {
     20  test(t => {
     21    assert_throws_js(TypeError, _ => Origin.from(invalid));
     22  }, `Origin.from(${invalid}) throws a TypeError.`);
     23 }
     24 
     25 // Specific object types are tested in `origin-from-*.js` in this directory.