B2G/gecko/services/common/modules-testing/storageserver.js
/**
   * Create a new user, complete with an empty set of collections.
   *
   * @param username
   *        The username to use. An Error will be thrown if a user by that name
   *        already exists.
   * @param password
   *        A password string.
   *
   * @return a user object, as would be returned by server.user(username).
   */
Create a new user, complete with an empty set of collections.
@param username
The username to use. An Error will be thrown if a user by that name
already exists.
@param password
A password string.

@return a user object, as would be returned by server.user(username).
Create a new user complete with an empty set of collections . @param username The username to use . An Error will be thrown if a user by that name already exists . @param password A password string . @return a user object as would be returned by server . user ( username ) .
function registerUser(username, password) {
    if (username in this.users) {
      throw new Error("User already exists.");
    }
    if (!isFinite(parseInt(username))) {
      throw new Error("Usernames must be numeric: " + username);
    }
    this._log.info("Registering new user with server: " + username);
    this.users[username] = {
      password: password,
      collections: {},
      quota: this.DEFAULT_QUOTA,
    };
    return this.user(username);
  }
function registerUser ( username , password ) { if ( username in this . users ) { throw new Error ( "User already exists." ) ; } if ( ! isFinite ( parseInt ( username ) ) ) { throw new Error ( "Usernames must be numeric: " + username ) ; } this . _log . info ( "Registering new user with server: " + username ) ; this . users [ username ] = { password : password , collections : { } , quota : this . DEFAULT_QUOTA , } ; return this . user ( username ) ; }
Create a new user, complete with an empty set of collections.
Create a new user complete with an empty set of collections .