Sets methods on a prototype object

Allows hooks to be overwritten

@method proto
@param  {Object} obj  Object receiving prototype extension
@param  {String} type Identifier of obj, determines what Arrays to apply
@return {Object}      obj or undefined
336278
function ( obj, type ) {
		var target = obj.prototype || obj;

		utility.iterate( prototypes[type], function ( v, k ) {
			if ( !target[k] ) {
				utility.property( target, k, {value: v, configurable: true, writable: true} );
			}
		});

		return obj;
	}
380805
function getType (obj) {
  var str = Object.prototype.toString.call(obj);
  if (natives[str]) return natives[str];
  if (obj === null) return 'null';
  if (obj === undefined) return 'undefined';
  if (obj === Object(obj)) return 'object';
  return typeof obj;
}
1360371
function set(obj, key, val) {
  var v = obj[key];
  if (hasOwnProperty.call(Object.prototype, key)) return;
  if (undefined === v) {
    obj[key] = val;
  } else if (isArray(v)) {
    v.push(val);
  } else {
    obj[key] = [v, val];
  }
}
759171
function extendClass(parent, members) {
        var object = function () { return UNDEFINED; };
        object.prototype = new parent();
        extend(object.prototype, members);
        return object;
    }
654164
function bindMethods (obj, methods) {
  methods = [].slice.call(arguments, 1);
  for (var i = 0, method; method = methods[i]; i++) {
    obj[method] = bind(obj, obj[method]);
  }
  return obj;
}
245397
function alias (obj, method) {
  switch (type(method)) {
    case 'object': return aliasByDictionary(clone(obj), method);
    case 'function': return aliasByFunction(clone(obj), method);
  }
}
1254102
final boolean setPrototype(ObjectType prototype, Node propertyNode) {
    if (prototype == null) {
      return false;
    }
    // getInstanceType fails if the function is not a constructor
    if (isConstructor() && prototype == getInstanceType()) {
      return false;
    }
    return setPrototypeNoCheck(prototype, propertyNode);
  }
1323952
function defineOnPrototype(ctor, methods) {
  var proto = ctor.prototype;
  forEachProperty(methods, function(val, key) {
    proto[key] = val;
  });
}
623512
function typeIs(object, types) {

	var type = typeOf(object);
	var _types = types;

	if (arguments.length === 2 && typeof types === 'string') {
		return type === types;
	} else if (!_isArray(types) && arguments.length > 2) {
		_types = Array.prototype.slice.call(arguments, 1);
	}

	return Array.has(_types, type);
}
263260
function(json) {
			edb.Type.prototype.$onconstruct.apply(this, arguments);
			switch (gui.Type.of(json)) {
				case "object":
				case "undefined":
				case "null":
					var proxy = gui.Object.copy(json || {});
					var types = edb.ObjectPopulator.populate(proxy, this);
					edb.ObjectProxy.approximate(proxy, this, types);
					break;
				default:
					throw new TypeError(
						"Unexpected edb.Object constructor argument of type " +
						gui.Type.of(json) + ": " + String(json)
					);
			}
			this.onconstruct();
			if (this.oninit) {
				console.error("Deprecated API is deprecated: " + this + ".oninit");
			}
		}
90163
function() {

      // Not as nice as arguments.callee but at least we'll only have on reference.
      var _this = this;
      var extend = function() { return _this.extend.apply(_this, arguments); };

      // If we don't have enough arguments to do anything, just return an object
      if (arguments.length < 2) {
        return {};
      }

      // Argument shuffling
      if (typeof arguments[0] !== 'boolean') {
        Array.prototype.unshift.call(arguments, true);
      }

      // Remove the variables we need from the arguments stack.
      var deep = Array.prototype.shift.call(arguments);
      var one = Array.prototype.shift.call(arguments);
      var two = Array.prototype.shift.call(arguments);

      // If we have more than two objects to merge
      if (arguments.length > 0) {

        // Push two back on to the arguments stack, it's no longer special.
        Array.prototype.unshift.call(arguments, two);

        // While we have any more arguments, call extend with the initial obj and the next argument
        while (arguments.length > 0) {
          two = Array.prototype.shift.call(arguments);

          if (typeof two !== 'object') continue;

          one = extend(deep, one, two);
        }

        return one;
      }

      // Do some checking to force one and two to be objects
      if (typeof one !== 'object') {
        one = {};
      }

      if (typeof two !== 'object') {
        two = {};
      }

      // Loop through the second object to merge it with the first
      for (var key in two) {
        // If this key actually belongs to the second argument
        if (Object.prototype.hasOwnProperty.call(two, key)) {
          var current = two[key];

          if (deep && typeof current === 'object' && typeof one[key] === 'object') {
            // Deep copy
            one[key] = extend(one[key], current);
          } else {
            one[key] = current;
          }
        }
      }

      return one;
    }
318159
function type(obj) {
	return obj === undefined ? 'undefined' :
		Object.prototype.toString.call(obj)
			.replace(/^\[object (.+)]$/, '$1')
			.toLowerCase();
}
1287039
function wrapObject(object, methods) {
      if (!(methods instanceof Array)) methods = Array.prototype.slice.call(arguments, 1);
      methods.forEach(function (method) {
        object[method] = wrap(object[method]);
      });
    }
974868
def define_method(id, prototype)
      m = Method.new(id)
      m.from_prototype(prototype)
      define(m)
    end
80097
function clone(obj) {
  if (null == obj || "object" != typeof obj)
    return obj;

  if (obj instanceof Object) {
    var copy = {};
    for (var attr in obj) {
      if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);
    }
    return copy;
  }

  throw new Error("Unable to copy obj! Its type isn't supported.");
}
241524
function i (obj, showHidden, depth) {
    var seen = [];

    function stylize (str) {
      return str;
    }

    function format (value, recurseTimes) {
      // Provide a hook for user-specified inspect functions.
      // Check that value is an object with an inspect function on it
      if (value && typeof value.inspect === 'function' &&
          // Filter out the util module, it's inspect function is special
          value !== exports &&
          // Also filter out any prototype objects using the circular check.
          !(value.constructor && value.constructor.prototype === value)) {
        return value.inspect(recurseTimes);
      }

      // Primitive types cannot have properties
      switch (typeof value) {
        case 'undefined':
          return stylize('undefined', 'undefined');

        case 'string':
          var simple = '\'' + json.stringify(value).replace(/^"|"$/g, '')
                                                   .replace(/'/g, "\\'")
                                                   .replace(/\\"/g, '"') + '\'';
          return stylize(simple, 'string');

        case 'number':
          return stylize('' + value, 'number');

        case 'boolean':
          return stylize('' + value, 'boolean');
      }
      // For some reason typeof null is "object", so special case here.
      if (value === null) {
        return stylize('null', 'null');
      }

      if (isDOMElement(value)) {
        return getOuterHTML(value);
      }

      // Look up the keys of the object.
      var visible_keys = keys(value);
      var $keys = showHidden ? Object.getOwnPropertyNames(value) : visible_keys;

      // Functions without properties can be shortcutted.
      if (typeof value === 'function' && $keys.length === 0) {
        if (isRegExp(value)) {
          return stylize('' + value, 'regexp');
        } else {
          var name = value.name ? ': ' + value.name : '';
          return stylize('[Function' + name + ']', 'special');
        }
      }

      // Dates without properties can be shortcutted
      if (isDate(value) && $keys.length === 0) {
        return stylize(value.toUTCString(), 'date');
      }
      
      // Error objects can be shortcutted
      if (value instanceof Error) {
        return stylize("["+value.toString()+"]", 'Error');
      }

      var base, type, braces;
      // Determine the object type
      if (isArray(value)) {
        type = 'Array';
        braces = ['[', ']'];
      } else {
        type = 'Object';
        braces = ['{', '}'];
      }

      // Make functions say that they are functions
      if (typeof value === 'function') {
        var n = value.name ? ': ' + value.name : '';
        base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']';
      } else {
        base = '';
      }

      // Make dates with properties first say the date
      if (isDate(value)) {
        base = ' ' + value.toUTCString();
      }

      if ($keys.length === 0) {
        return braces[0] + base + braces[1];
      }

      if (recurseTimes < 0) {
        if (isRegExp(value)) {
          return stylize('' + value, 'regexp');
        } else {
          return stylize('[Object]', 'special');
        }
      }

      seen.push(value);

      var output = map($keys, function (key) {
        var name, str;
        if (value.__lookupGetter__) {
          if (value.__lookupGetter__(key)) {
            if (value.__lookupSetter__(key)) {
              str = stylize('[Getter/Setter]', 'special');
            } else {
              str = stylize('[Getter]', 'special');
            }
          } else {
            if (value.__lookupSetter__(key)) {
              str = stylize('[Setter]', 'special');
            }
          }
        }
        if (indexOf(visible_keys, key) < 0) {
          name = '[' + key + ']';
        }
        if (!str) {
          if (indexOf(seen, value[key]) < 0) {
            if (recurseTimes === null) {
              str = format(value[key]);
            } else {
              str = format(value[key], recurseTimes - 1);
            }
            if (str.indexOf('\n') > -1) {
              if (isArray(value)) {
                str = map(str.split('\n'), function (line) {
                  return '  ' + line;
                }).join('\n').substr(2);
              } else {
                str = '\n' + map(str.split('\n'), function (line) {
                  return '   ' + line;
                }).join('\n');
              }
            }
          } else {
            str = stylize('[Circular]', 'special');
          }
        }
        if (typeof name === 'undefined') {
          if (type === 'Array' && key.match(/^\d+$/)) {
            return str;
          }
          name = json.stringify('' + key);
          if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
            name = name.substr(1, name.length - 2);
            name = stylize(name, 'name');
          } else {
            name = name.replace(/'/g, "\\'")
                       .replace(/\\"/g, '"')
                       .replace(/(^"|"$)/g, "'");
            name = stylize(name, 'string');
          }
        }

        return name + ': ' + str;
      });

      seen.pop();

      var numLinesEst = 0;
      var length = reduce(output, function (prev, cur) {
        numLinesEst++;
        if (indexOf(cur, '\n') >= 0) numLinesEst++;
        return prev + cur.length + 1;
      }, 0);

      if (length > 50) {
        output = braces[0] +
                 (base === '' ? '' : base + '\n ') +
                 ' ' +
                 output.join(',\n  ') +
                 ' ' +
                 braces[1];

      } else {
        output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
      }

      return output;
    }
    return format(obj, (typeof depth === 'undefined' ? 2 : depth));
  }
558022
function typeOf(obj) {
        if (obj === undefined) {
            return 'undefined';
        }

        if (obj === null) {
            return 'null';
        }

        var t = Object.prototype.toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(),
            m;

        if (t !== 'object') {
            return t;
        }

        m = obj.constructor.toString().match(/^function\s*([$A-Z_][0-9A-Z_$]*)/i);
        if (m === null) {
            return 'object';
        }

        return m[1];
    }