How to use the webidl-conversions.USVString function in webidl-conversions

To help you get started, we’ve selected a few webidl-conversions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flaviuse / mern-authentication / client / node_modules / jsdom / lib / jsdom / living / xmlhttprequest.js View on Github external
open(method, uri, asynchronous, user, password) {
      if (!this._ownerDocument) {
        throw new DOMException("The object is in an invalid state.", "InvalidStateError");
      }
      const flag = this[xhrSymbols.flag];
      const properties = this[xhrSymbols.properties];
      const argumentCount = arguments.length;
      if (argumentCount < 2) {
        throw new TypeError("Not enough arguments (expected at least 2)");
      }

      method = conversions.ByteString(method);
      uri = conversions.USVString(uri);
      if (user) {
        user = conversions.USVString(user);
      }
      if (password) {
        password = conversions.USVString(password);
      }

      if (!tokenRegexp.test(method)) {
        throw new DOMException("The string did not match the expected pattern.", "SyntaxError");
      }
      const upperCaseMethod = method.toUpperCase();
      if (forbiddenRequestMethods.has(upperCaseMethod)) {
        throw new DOMException("The operation is insecure.", "SecurityError");
      }

      const { client } = properties;
github flaviuse / mern-authentication / client / node_modules / jsdom / lib / jsdom / living / generated / File.js View on Github external
}
  const args = [];
  {
    let curArg = arguments[0];
    if (!utils.isObject(curArg)) {
      throw new TypeError("Failed to construct 'File': parameter 1" + " is not an iterable object.");
    } else {
      const V = [];
      const tmp = curArg;
      for (let nextItem of tmp) {
        if (isBlob(nextItem)) {
          nextItem = utils.implForWrapper(nextItem);
        } else if (nextItem instanceof ArrayBuffer) {
        } else if (ArrayBuffer.isView(nextItem)) {
        } else {
          nextItem = conversions["USVString"](nextItem, {
            context: "Failed to construct 'File': parameter 1" + "'s element"
          });
        }
        V.push(nextItem);
      }
      curArg = V;
    }
    args.push(curArg);
  }
  {
    let curArg = arguments[1];
    curArg = conversions["USVString"](curArg, { context: "Failed to construct 'File': parameter 2" });
    args.push(curArg);
  }
  {
    let curArg = arguments[2];
github zubairghori / Ultimate_todo_list / node_modules / jsdom / lib / jsdom / living / generated / HTMLAreaElement.js View on Github external
set(V) {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    V = conversions["USVString"](V, {
      context: "Failed to set the 'username' property on 'HTMLAreaElement': The provided value"
    });

    this[impl]["username"] = V;
  },
github sx1989827 / DOClever / node_modules / jsdom / lib / jsdom / living / generated / HTMLAreaElement.js View on Github external
set(V) {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    V = conversions["USVString"](V, {
      context: "Failed to set the 'hash' property on 'HTMLAreaElement': The provided value"
    });

    this[impl]["hash"] = V;
  },
github sx1989827 / DOClever / Server / node_modules / jsdom / lib / jsdom / living / generated / Location.js View on Github external
set(V) {
        if (!this || !module.exports.is(this)) {
          throw new TypeError("Illegal invocation");
        }

        V = conversions["USVString"](V, {
          context: "Failed to set the 'port' property on 'Location': The provided value"
        });

        obj[impl]["port"] = V;
      },
github stasm / innerself / node_modules / whatwg-url / lib / URL.js View on Github external
set(V) {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    V = conversions["USVString"](V, { context: "Failed to set the 'password' property on 'URL': The provided value" });

    this[impl]["password"] = V;
  },
github flaviuse / mern-authentication / client / node_modules / jsdom / lib / jsdom / living / generated / WebSocket.js View on Github external
if (new.target === undefined) {
        throw new TypeError(
          "Failed to construct 'WebSocket'. Please use the 'new' operator; this constructor " +
            "cannot be called as a function."
        );
      }

      if (arguments.length < 1) {
        throw new TypeError(
          "Failed to construct 'WebSocket': 1 argument required, but only " + arguments.length + " present."
        );
      }
      const args = [];
      {
        let curArg = arguments[0];
        curArg = conversions["USVString"](curArg, { context: "Failed to construct 'WebSocket': parameter 1" });
        args.push(curArg);
      }
      {
        let curArg = arguments[1];
        if (curArg !== undefined) {
          if (utils.isObject(curArg)) {
            if (curArg[Symbol.iterator] !== undefined) {
              if (!utils.isObject(curArg)) {
                throw new TypeError(
                  "Failed to construct 'WebSocket': parameter 2" + " sequence" + " is not an iterable object."
                );
              } else {
                const V = [];
                const tmp = curArg;
                for (let nextItem of tmp) {
                  nextItem = conversions["DOMString"](nextItem, {
github gazooka / GhostInAzureWebApp / node_modules / jsdom / lib / jsdom / living / generated / HTMLObjectElement.js View on Github external
set data(V) {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    V = conversions["USVString"](V, {
      context: "Failed to set the 'data' property on 'HTMLObjectElement': The provided value"
    });

    this[impl]["data"] = V;
  }
github zubairghori / Ultimate_todo_list / node_modules / jsdom / lib / jsdom / living / generated / HTMLScriptElement.js View on Github external
set(V) {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    V = conversions["USVString"](V, {
      context: "Failed to set the 'src' property on 'HTMLScriptElement': The provided value"
    });

    this[impl]["src"] = V;
  },
github flaviuse / mern-authentication / client / node_modules / jsdom / lib / jsdom / living / generated / HTMLAnchorElement.js View on Github external
set(V) {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    V = conversions["USVString"](V, {
      context: "Failed to set the 'search' property on 'HTMLAnchorElement': The provided value"
    });

    this[impl]["search"] = V;
  },