code: function URL(input, base) {
          var baseURL;
          if (base) {
              base = base.href || base;
              baseURL = _parseURL(base);
              if (!baseURL || !baseURL.scheme) {
                  throw new SyntaxError();
              }
              Object.defineProperty(this, "_baseURL", {
                  value: baseURL
              });
          }
  
          var url = _parseURL(input, baseURL);
          if (!url) {
              throw new SyntaxError();
          }
  
          Object.defineProperty(this, "_input", {
              value: input,
              writable: true
          });
  
          Object.defineProperty(this, "_url", {
              value: url,
              writable: true
          });
  
          var query = new URLQuery(this);
          Object.defineProperty(this, "query", {
              get: function() {
                  return this._url ? query : null;
              },
              enumerable: true
          });
      }
docs: See https://url.spec.whatwg.org/#api