code: function(attrs, options) {
        var error;
        options = options || {};
  
        var username = (attrs && attrs.username) || this.get("username");
        if (!username || (username === "")) {
          error = new Parse.Error(
              Parse.Error.OTHER_CAUSE,
              "Cannot sign up user with an empty name.");
          if (options && options.error) {
            options.error(this, error);
          }
          return Parse.Promise.error(error);
        }
  
        var password = (attrs && attrs.password) || this.get("password");
        if (!password || (password === "")) {
          error = new Parse.Error(
              Parse.Error.OTHER_CAUSE,
              "Cannot sign up user with an empty password.");
          if (options && options.error) {
            options.error(this, error);
          }
          return Parse.Promise.error(error);
        }
  
        // Overridden so that the user can be made the current user.
        var newOptions = _.clone(options);
        newOptions.success = function(model) {
          model._handleSaveResult(true);
          if (options.success) {
            options.success.apply(this, arguments);
          }
        };
        return this.save(attrs, newOptions);
      }
docs: Signs up a new user. You should call this instead of save for
  new Parse.Users. This will create a new Parse.User on the server, and
  also persist the session on disk so that you can access the user using
  <code>current</code>.
  
  <p>A username and password must be set before calling signUp.</p>
  
  <p>Calls options.success or options.error on completion.</p>
  
  @param {Object} attrs Extra fields to set on the new user, or null.
  @param {Object} options A Backbone-style options object.
  @return {Parse.Promise} A promise that is fulfilled when the signup
  finishes.
  @see Parse.User.signUp