B2G/gecko/toolkit/content/Dict.jsm
/**
   * Sets a lazy getter function for a key's value. If the key is a not a string,
   * it will be converted to a string before the set happens.
   * @param aKey
   *        The key to set
   * @param aThunk
   *        A getter function to be called the first time the value for aKey is
   *        retrieved. It is guaranteed that aThunk wouldn't be called more
   *        than once.  Note that the key value may be retrieved either
   *        directly, by |get|, or indirectly, by |listvalues| or by iterating
   *        |values|.  For the later, the value is only retrieved if and when
   *        the iterator gets to the value in question.  Also note that calling
   *        |has| for a lazy-key does not invoke aThunk.
   *
   * @note No context is provided for aThunk when it's invoked.
   *       Use Function.bind if you wish to run it in a certain context.
   */
Sets a lazy getter function for a key's value. If the key is a not a string,
it will be converted to a string before the set happens.
@param aKey
The key to set
@param aThunk
A getter function to be called the first time the value for aKey is
retrieved. It is guaranteed that aThunk wouldn't be called more
than once.

@note No context is provided for aThunk when it's invoked.
Use Function.bind if you wish to run it in a certain context.
Sets a lazy getter function for a key ' s value . If the key is a not a string it will be converted to a string before the set happens . @param aKey The key to set @param aThunk A getter function to be called the first time the value for aKey is retrieved . It is guaranteed that aThunk wouldn ' t be called more than once . @note No context is provided for aThunk when it ' s invoked . Use Function . bind if you wish to run it in a certain context .
function Dict_setAsLazyGetter(aKey, aThunk) {
    let prop = convert(aKey);
    let items = this._state.items;
    if (!items.hasOwnProperty(prop))
      this._state.count++;
    Object.defineProperty(items, prop, {
      get: function() {
        delete items[prop];
        return items[prop] = aThunk();
      },
      configurable: true,
      enumerable: true     
    });
  }
function Dict_setAsLazyGetter ( aKey , aThunk ) { let prop = convert ( aKey ) ; let items = this . _state . items ; if ( ! items . hasOwnProperty ( prop ) ) this . _state . count ++ ; Object . defineProperty ( items , prop , { get : function ( ) { delete items [ prop ] ; return items [ prop ] = aThunk ( ) ; } , configurable : true , enumerable : true } ) ; }
Sets a lazy getter function for a key's value.
Sets a lazy getter function for a key ' s value .