nl_tokens: Convenience function to create new types of heads . It takes care of a bit of inheritance hassle .
pl_tokens: function robohydraHeadType ( settings ) { var parentClass = settings . parentClass || RoboHydraHead ; var newConstructorFunction = function ( props ) { if ( ! props && settings . defaultProps ) { deprecationWarning ( "deprecated 'defaultProps', please use 'defaultPropertyObject' instead" ) ; props = settings . defaultProps ; } props = props || settings . defaultPropertyObject || { } ; // Checks mandatory and optional properties this . _importProperties ( newConstructorFunction , props ) ; var parentPropBuilder = settings . parentPropertyBuilder || function ( ) { return { } ; } ; if ( settings . parentPropBuilder ) { deprecationWarning ( "deprecated 'parentPropBuilder', please use 'parentPropertyBuilder' instead" ) ; parentPropBuilder = settings . parentPropBuilder ; } var parentProps = parentPropBuilder . call ( this ) ; IMPLICIT_OPTIONAL_PROPS . forEach ( function ( p ) { var propName = typeof p === 'object' ? p . name : p ; if ( ! ( propName in parentProps ) ) { parentProps [ propName ] = this [ propName ] ; } } , this ) ; parentClass . call ( this , parentProps ) ; this . type = settings . name || '<undefined>' ; if ( typeof settings . init === 'function' ) { settings . init . <mask> ( this ) ; } } ; newConstructorFunction . mandatoryProperties = settings . mandatoryProperties || [ ] ; newConstructorFunction . optionalProperties = ( settings . optionalProperties || [ ] ) . concat ( IMPLICIT_OPTIONAL_PROPS ) ; newConstructorFunction . prototype = new parentClass ( ) ; return newConstructorFunction ; }