B2G/gecko/services/common/modules-testing/storageserver.js
/**
   * Simple accessor to allow collective binding and abbreviation of a bunch of
   * methods. Yay!
   * Use like this:
   *
   *   let u = server.user("john");
   *   u.collection("bookmarks").bso("abcdefg").payload;  // Etc.
   *
   * @return a proxy for the user data stored in this server.
   */
Simple accessor to allow collective binding and abbreviation of a bunch of
methods. Yay.
Use like this.



@return a proxy for the user data stored in this server.
Simple accessor to allow collective binding and abbreviation of a bunch of methods . Yay . Use like this . @return a proxy for the user data stored in this server .
function user(username) {
    let collection       = this.getCollection.bind(this, username);
    let createCollection = this.createCollection.bind(this, username);
    let createContents   = this.createContents.bind(this, username);
    let modified         = function (collectionName) {
      return collection(collectionName).timestamp;
    }
    let deleteCollections = this.deleteCollections.bind(this, username);
    let quota             = this.getQuota.bind(this, username);
    return {
      collection:        collection,
      createCollection:  createCollection,
      createContents:    createContents,
      deleteCollections: deleteCollections,
      modified:          modified,
      quota:             quota,
    };
  }
function user ( username ) { let collection = this . getCollection . bind ( this , username ) ; let createCollection = this . createCollection . bind ( this , username ) ; let createContents = this . createContents . bind ( this , username ) ; let modified = function ( collectionName ) { return collection ( collectionName ) . timestamp ; } let deleteCollections = this . deleteCollections . bind ( this , username ) ; let quota = this . getQuota . bind ( this , username ) ; return { collection : collection , createCollection : createCollection , createContents : createContents , deleteCollections : deleteCollections , modified : modified , quota : quota , } ; }
Simple accessor to allow collective binding and abbreviation of a bunch of
 methods.
Simple accessor to allow collective binding and abbreviation of a bunch of methods .