code: function extend (prototypeProperties, constructorProperties) {
    // unpack args: default empty objects
    prototypeProperties || (prototypeProperties = {});
    constructorProperties || (constructorProperties = {});
    // end unpack args
    var parent = this;
    // constructor may be defined in prototypeProperties:
    var child = _.has(prototypeProperties, 'constructor') ?
      prototypeProperties.constructor :
      function () { parent.apply(this, arguments); };
    util.inherits(child, parent); // extend prototype from parent to child
    // Add constructor properties from parent and params. Set ``extend``
    // reference as well in case it is not defined on parent.
    _.extend(child, parent, constructorProperties, { extend: extend });
    // Add prototype properties from params. Set ``constructor`` reference too
    // because not all clients do this automatically.
    _.extend(child.prototype, prototypeProperties, { constructor: child });
    return child;
  }
docs: Creates a child of ``this`` constructor, optionally with additional prototype and constructor properties. Preserves inheritance chain for use of ``instanceof``. Child constructors contain a reference to ``extend``, and prototypes include a valid ``constructor`` reference. Example: var MyErrorType = extend.call(Error, { name: 'MyErrorType' });