benchmarks/scenarios/ember.js
function inheritedMapOfMaps(name, Meta) {
    var key = memberProperty(name);
    var capitalized = capitalize(name);

    Meta.prototype['write' + capitalized] = function (subkey, itemkey, value) {
      var outerMap = this._getOrCreateOwnMap(key);
      var innerMap = outerMap[subkey];
      if (!innerMap) {
        innerMap = outerMap[subkey] = new _emberMetalEmpty_object.default();
      }
      innerMap[itemkey] = value;
    };

    Meta.prototype['peek' + capitalized] = function (subkey, itemkey) {
      var pointer = this;
      while (pointer !== undefined) {
        var map = pointer[key];
        if (map) {
          var value = map[subkey];
          if (value) {
            if (value[itemkey] !== undefined) {
              return value[itemkey];
            }
          }
        }
        pointer = pointer.parent;
      }
    };

    Meta.prototype['has' + capitalized] = function (subkey) {
      var pointer = this;
      while (pointer !== undefined) {
        if (pointer[key] && pointer[key][subkey]) {
          return true;
        }
        pointer = pointer.parent;
      }
      return false;
    };

    Meta.prototype['forEachIn' + capitalized] = function (subkey, fn) {
      return this._forEachIn(key, subkey, fn);
    };
  }
function inheritedMapOfMaps(name, Meta) {
    var key = memberProperty(name);
    var capitalized = capitalize(name);

    Meta.prototype['write' + capitalized] = function (subkey, itemkey, value) {
      var outerMap = this._getOrCreateOwnMap(key);
      var innerMap = outerMap[subkey];
      if (!innerMap) {
        innerMap = outerMap[subkey] = new _emberMetalEmpty_object.default();
      }
      innerMap[itemkey] = value;
    };

    Meta.prototype['peek' + capitalized] = function (subkey, itemkey) {
      var pointer = this;
      while (pointer !== undefined) {
        var map = pointer[key];
        if (map) {
          var value = map[subkey];
          if (value) {
            if (value[itemkey] !== undefined) {
              return value[itemkey];
            }
          }
        }
        pointer = pointer.parent;
      }
    };

    Meta.prototype['has' + capitalized] = function (subkey) {
      var pointer = this;
      while (pointer !== undefined) {
        if (pointer[key] && pointer[key][subkey]) {
          return true;
        }
        pointer = pointer.parent;
      }
      return false;
    };

    Meta.prototype['forEachIn' + capitalized] = function (subkey, fn) {
      return this._forEachIn(key, subkey, fn);
    };
  }
function inheritedMapOfMaps ( name , Meta ) { var key = memberProperty ( name ) ; var capitalized = capitalize ( name ) ; Meta . prototype [ 'write' + capitalized ] = function ( subkey , itemkey , value ) { var outerMap = this . _getOrCreateOwnMap ( key ) ; var innerMap = outerMap [ subkey ] ; if ( ! innerMap ) { innerMap = outerMap [ subkey ] = new _emberMetalEmpty_object . default ( ) ; } innerMap [ itemkey ] = value ; } ; Meta . prototype [ 'peek' + capitalized ] = function ( subkey , itemkey ) { var pointer = this ; while ( pointer !== undefined ) { var map = pointer [ key ] ; if ( map ) { var value = map [ subkey ] ; if ( value ) { if ( value [ itemkey ] !== undefined ) { return value [ itemkey ] ; } } } pointer = pointer . parent ; } } ; Meta . prototype [ 'has' + capitalized ] = function ( subkey ) { var pointer = this ; while ( pointer !== undefined ) { if ( pointer [ key ] && pointer [ key ] [ subkey ] ) { return true ; } pointer = pointer . parent ; } return false ; } ; Meta . prototype [ 'forEachIn' + capitalized ] = function ( subkey , fn ) { return this . _forEachIn ( key , subkey , fn ) ; } ; }
Implements a member that provides a lazily created map of maps, with inheritance at both levels.
Implements a member that provides a lazily created map of maps with inheritance at both levels .