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

    Meta.prototype['write' + capitalized] = function (subkey, value) {
      var map = this._getOrCreateOwnMap(key);
      map[subkey] = value;
    };

    Meta.prototype['peek' + capitalized] = function (subkey) {
      return this._findInherited(key, subkey);
    };

    Meta.prototype['forEach' + capitalized] = function (fn) {
      var pointer = this;
      var seen = new _emberMetalEmpty_object.default();
      while (pointer !== undefined) {
        var map = pointer[key];
        if (map) {
          for (var _key in map) {
            if (!seen[_key]) {
              seen[_key] = true;
              fn(_key, map[_key]);
            }
          }
        }
        pointer = pointer.parent;
      }
    };

    Meta.prototype['clear' + capitalized] = function () {
      this[key] = undefined;
    };

    Meta.prototype['deleteFrom' + capitalized] = function (subkey) {
      delete this._getOrCreateOwnMap(key)[subkey];
    };

    Meta.prototype['hasIn' + capitalized] = function (subkey) {
      return this._findInherited(key, subkey) !== undefined;
    };
  }
function inheritedMap(name, Meta) {
    var key = memberProperty(name);
    var capitalized = capitalize(name);

    Meta.prototype['write' + capitalized] = function (subkey, value) {
      var map = this._getOrCreateOwnMap(key);
      map[subkey] = value;
    };

    Meta.prototype['peek' + capitalized] = function (subkey) {
      return this._findInherited(key, subkey);
    };

    Meta.prototype['forEach' + capitalized] = function (fn) {
      var pointer = this;
      var seen = new _emberMetalEmpty_object.default();
      while (pointer !== undefined) {
        var map = pointer[key];
        if (map) {
          for (var _key in map) {
            if (!seen[_key]) {
              seen[_key] = true;
              fn(_key, map[_key]);
            }
          }
        }
        pointer = pointer.parent;
      }
    };

    Meta.prototype['clear' + capitalized] = function () {
      this[key] = undefined;
    };

    Meta.prototype['deleteFrom' + capitalized] = function (subkey) {
      delete this._getOrCreateOwnMap(key)[subkey];
    };

    Meta.prototype['hasIn' + capitalized] = function (subkey) {
      return this._findInherited(key, subkey) !== undefined;
    };
  }
function inheritedMap ( name , Meta ) { var key = memberProperty ( name ) ; var capitalized = capitalize ( name ) ; Meta . prototype [ 'write' + capitalized ] = function ( subkey , value ) { var map = this . _getOrCreateOwnMap ( key ) ; map [ subkey ] = value ; } ; Meta . prototype [ 'peek' + capitalized ] = function ( subkey ) { return this . _findInherited ( key , subkey ) ; } ; Meta . prototype [ 'forEach' + capitalized ] = function ( fn ) { var pointer = this ; var seen = new _emberMetalEmpty_object . default ( ) ; while ( pointer !== undefined ) { var map = pointer [ key ] ; if ( map ) { for ( var _key in map ) { if ( ! seen [ _key ] ) { seen [ _key ] = true ; fn ( _key , map [ _key ] ) ; } } } pointer = pointer . parent ; } } ; Meta . prototype [ 'clear' + capitalized ] = function ( ) { this [ key ] = undefined ; } ; Meta . prototype [ 'deleteFrom' + capitalized ] = function ( subkey ) { delete this . _getOrCreateOwnMap ( key ) [ subkey ] ; } ; Meta . prototype [ 'hasIn' + capitalized ] = function ( subkey ) { return this . _findInherited ( key , subkey ) !== undefined ; } ; }
Implements a member that is a lazily created POJO with inheritable values.
Implements a member that is a lazily created POJO with inheritable values .