simple class inheritance
@param {Function} child
@param {Function} base
@param {Object} [properties]
343132
function inherit(child, base, properties) {
    var baseP = base.prototype,
        childP;

    childP = child.prototype = Object.create(baseP);
    childP.constructor = child;
    childP._super = baseP;

    if (properties) {
        assign(childP, properties);
    }
}
677681
function child_nodes(node) {
  var properties = NODE_TYPES[node["type"]];

  if (properties === undefined) {
    console.error("FATAL".red + ": Unknown node type: " + node["type"]);
    console.trace();
    process.exit(1);
  }

   var x = properties.map(function(p) {
     return node[p];
   });

   return _.flatten(_.compact(x));
}
512536
function(name, prototype, base) {
      // require an object
      var source = prototype[name] || {};
      // chain inherited properties onto a new object
      prototype[name] = this.chainObject(source, base[name]);
    }
894194
function (Child, Parent) {
    // copy Parent static properties
    for (var key in Parent) {
      // make sure we only copy hasOwnProperty properties vs. prototype
      // properties
      if (_.has(Parent, key))
        Child[key] = Parent[key];
    }

    // a middle member of prototype chain: takes the prototype from the Parent
    var Middle = function () {
      this.constructor = Child;
    };
    Middle.prototype = Parent.prototype;
    Child.prototype = new Middle();
    Child.__super__ = Parent.prototype;
    return Child;
  }
769830
function isChild(child, parent) {
	while (child = child.parentNode) {
		if (child == parent) {
			return true;
		}
	}

	return false;
}
78375
function(child) {
            if (arguments.length > 1) {
                for (var i = 0; i < arguments.length; i++) {
                    this.add(arguments[i]);
                }
                return;
            }
            if (child.getParent()) {
                child.moveTo(this);
                return;
            }
            var children = this.children;
            this._validateAdd(child);
            child.index = children.length;
            child.parent = this;
            children.push(child);
            this._fire('add', {
                child: child
            });

            // chainable
            return this;
        }
311300
function copyBaseTCFieldsToChildTC(
  baseDTC: ObjectTypeComposer<any, any>,
  childTC: ObjectTypeComposer<any, any>
) {
  const baseFields = baseDTC.getFieldNames();
  const childFields = childTC.getFieldNames();

  for (const field of baseFields) {
    const isFieldExists = childFields.find(fld => fld === field);

    if (isFieldExists) {
      childTC.extendField(field, {
        type: baseDTC.getField(field).type,
      });
    } else {
      childTC.setField(field, baseDTC.getField(field));
    }
  }

  return childTC;
}
192507
function(children) {
			_assert(
				children && (!this.children || this.children.length === 0),
				"only init supported"
			);
			this.children = [];
			for (var i = 0, l = children.length; i < l; i++) {
				this.children.push(new FancytreeNode(this, children[i]));
			}
		}
916088
function(base) {
    for (var i=1; i < arguments.length; i++) {
      var ext = arguments[i];
      for (var key in ext) {
        if (ext.hasOwnProperty(key)) base[key] = ext[key];
      }
    }
    return base;
  }
1065923
@Override
  public void applySubclassRelationship(
      final NominalTypeBuilder parent, final NominalTypeBuilder child, SubclassType type) {
    super.applySubclassRelationship(parent, child, type);
    if (type == SubclassType.INHERITS) {
      final FunctionType childCtor = child.constructor();
      child.declareConstructorProperty(
          "superClass_", parent.prototypeOrInstance(), childCtor.getSource());
      // Notice that constructor functions do not need to be covariant on the superclass.
      // So if G extends F, new G() and new F() can accept completely different argument
      // types, but G.prototype.constructor needs to be covariant on F.prototype.constructor.
      // To get around this, we just turn off type-checking on arguments and return types
      // of G.prototype.constructor.
      FunctionType qmarkCtor = childCtor.forgetParameterAndReturnTypes();
      child.declarePrototypeProperty("constructor", qmarkCtor, childCtor.getSource());
    }
  }
1305239
function baseConforms(source) {
      var props = keys(source);
      return function(object) {
        return baseConformsTo(object, source, props);
      };
    }
568616
function extend(target,       // @arg Object - global
                constructors, // @arg ConstructorObject - { "Object": { keys: Object_keys, ... }, ... }
                override) {   // @arg Boolean = false
//{@dev
    if (!global["BENCHMARK"]) {
        $valid($type(constructors, "Object"),       extend, "constructors");
        $valid($type(override,     "Boolean|omit"), extend, "override");
    }
//}@dev

    override = override || false;

    for (var klass in constructors) { // Object, Array, String, Function, ...
        if ( !(klass in target) ) {
            target[klass] = constructors[klass];
        }
        _extend(target[klass], constructors[klass]);
    }

    function _extend(extendTarget, object) {
        for (var key in object) { // "keys", "prototype", ...
            if (key === "prototype") {
                // --- extend Object.property ---
                if (!(key in extendTarget)) { // extendTarget has prototype?
                    extendTarget[key] = {};   // extendTarget["prototype"] = {}
                }
                for (var prop in object[key]) {
                    _defineProperty(extendTarget[key], prop, object[key][prop]);
                }
            } else {
                _defineProperty(extendTarget, key, object[key]);
            }
        }
    }

    function _defineProperty(obj, key, value) {
        if ( override || !(key in obj) ) {
            Object.defineProperty(obj, key, {
                "configurable": true, // false is immutable
                "enumerable": false,  // false is invisible(for in loop)
                "writable": true,     // false is read-only
                "value": value
            });
        }
    }
}
353293
function(parent, protoProps, staticProps) {
  var child;

  // The constructor function for the new subclass is either defined by you
  // (the "constructor" property in your extend definition), or defaulted
  // by us to simply call the parent's constructor.
  if (protoProps && protoProps.hasOwnProperty('constructor')) {
    child = protoProps.constructor;
  } else {
    child = function(){ parent.apply(this, arguments); };
  }

  // Inherit class (static) properties from parent.
  copyProps(child, parent);

  // Set the prototype chain to inherit from parent, without calling
  // parent's constructor function.
  ctor.prototype = parent.prototype;
  child.prototype = new ctor();

  // Add prototype properties (instance properties) to the subclass,
  // if supplied.
  if (protoProps) copyProps(child.prototype, protoProps);

  // Add static properties to the constructor function, if supplied.
  if (staticProps) copyProps(child, staticProps);

  // Correctly set child's 'prototype.constructor'.
  child.prototype.constructor = child;

  // Set a convenience property in case the parent's prototype is needed later.
  child.__super__ = parent.prototype;

  return child;
}
110228
function Child(file) {
  if (!(this instanceof Child))
    return new Child(file);

  EventEmitter.call(this);

  bindExit();
  children.add(this);

  this.init(file);
}
48786
function Class(parent, api) {
    if ( !api) {
      parent = (api = parent, 0); // !api means there's no parent
    }

    // TODO remove $statics, use $static instead
    var clazz, constructor, singleton, statics, key, bindTo, len, i = 0, p,
        ignoredKeys = { constructor: 1, $singleton: 1, $static:1, $statics: 1, prototype: 1, $super: 1, $superp: 1, main: 1, toString: 0 },
        plugins     = Class.plugins,
        rootParent, parentClass, Stub, descriptor;

    api         = (typeof api === "function" ? api() : api) || {};             // execute api if it's a function
    constructor = api.hasOwnProperty("constructor") ? api.constructor : null;  // hasOwnProperty is a must, constructor is special
    singleton   = api.$singleton;
    statics     = api.$statics || api.$static;

    // add plugins' keys into ignoredKeys
    for (key in plugins) { ignoredKeys[key] = 1; }

    // make sure parent be always an array
    parent = !parent || parent instanceof Array ? parent : [ parent ];
    len = parent && parent.length;
    rootParent = parent[0];

    // construct constructor
    clazz = singleton ? function(){} : (constructor ? constructor : function(){
      if (rootParent) {
        rootParent.apply(this, arguments);
      }
    });

    if ( !singleton && len) {
      parentClass = rootParent.prototype && rootParent === rootParent.prototype.constructor && rootParent;

      if ( !parentClass) {
        clazz.prototype = rootParent;
      } else {
        // Constributed by Freddy Snijder (https://github.com/tnhu/jsface/issues/26)
        Stub = function(){};

        Stub.prototype                    = parentClass.prototype;
        Stub.prototype.constructor        = Stub;
        clazz.prototype                   = new Stub();
        clazz.prototype.constructor       = clazz;       // restoring proper constructor for child class
        parentClass.prototype.constructor = parentClass; // restoring proper constructor for parent class
      }
    }

    // determine bindTo: where api should be bound
    bindTo = singleton ? clazz : clazz.prototype;

    // do inherit static properties and extentions (parents other than the first one)
    while (i < len) {
      p = parent[i++];

      // copy static properties
      for (key in p) {
        if ( !ignoredKeys[key]) {
          clazz[key] = p[key];
        }
      }
      if ( !singleton && i !== 0) {
        for (key in p.prototype) {
          if ( !ignoredKeys[key]) {
            descriptor = Object.getOwnPropertyDescriptor(p.prototype, key);                                    // Fix #37
            bindTo[key] = (descriptor && (descriptor.get || descriptor.set)) ? descriptor : p.prototype[key]; 
          }
        }
      }
    }

    // copy properties from api to bindTo
    for (key in api) {
      if ( !ignoredKeys[key]) {
        var prop = api[key];

        if (prop && (prop.get || prop.set)) {                 // check if it is a property descriptor
          prop.enumerable = true;
          Object.defineProperty(bindTo, key, prop);
        } else {
          bindTo[key] = prop;
        }
      }
    }

    // copy static properties from statics to clazz
    for (key in statics) {
      clazz[key] = statics[key];
    }

    // add $super and $superp to refer to parent class and parent.prototype (if applied)
    p = parent && rootParent || parent;
    clazz.$super  = p;
    clazz.$superp = p && p.prototype || p;

    for (key in plugins) { plugins[key](clazz, parent, api); }            // pass control to plugins
    if (typeof api.main === "function") { api.main.call(clazz, clazz); }  // execute main()

    return clazz;
  }
1118255
function composeClass(base, mixin) {
  if (typeof mixin === 'function') {
    // Mixin function
    return mixin(base);
  } else {
    // Mixin object
    class Subclass extends base {}
    copyOwnProperties(mixin, Subclass.prototype, NON_MIXABLE_OBJECT_PROPERTIES);
    return Subclass;
  }
}
1038487
function WithName(name, Base) {
  let BaseClass =  Base || Therror;
  return class extends BaseClass {
    constructor(err, msg, prop) {
      super(err, msg, prop);
      this.name = name;
    }
  };
}