react-mixin-manager.js
function addTo(name) {
            var indexName = name,
                match = name.match(/^([^\(]*)\s*\(([^\)]*)\)\s*/),
                params = match && match[2];
            name = match && match[1] || name;

            if (!index[indexName]) {
                if (params) {
                    // there can be no function calls here because of the regex match
                    /*jshint evil: true */
                    params = eval('[' + params + ']');
                }
                var mixin = _mixins[name],
                    checkAgain = false,
                    skip = false;

                if (mixin) {
                    if (typeof mixin === 'function') {
                        if (_initiatedOnce[name]) {
                            if (!initiatedOnce[name]) {
                                initiatedOnce[name] = [];
                                // add the placeholder so the mixin ends up in the right place
                                // we will replace all names with the appropriate mixins at the end
                                // (so we have all of the appropriate arguments)
                                mixin = name;
                            } else {
                                // but we only want to add it a single time
                                skip = true;
                            }
                            if (params) {
                                initiatedOnce[name].push(params);
                            }
                        } else {
                            mixin = mixin.apply(this, params || []);
                            checkAgain = true;
                        }
                    } else if (params) {
                        throw new Error('the mixin "' + name + '" does not support parameters');
                    }
                    get(_dependsOn[name], index, initiatedOnce, rtn);
                    get(_dependsInjected[name], index, initiatedOnce, rtn);

                    index[indexName] = true;
                    if (checkAgain) {
                        get([mixin], index, initiatedOnce, rtn);
                    } else if (!skip) {
                        checkForInlineMixins(mixin, rtn);
                        rtn.push(mixin);
                    }

                } else {
                    throw new Error('invalid mixin "' + name + '"');
                }
            }
        }
function addTo(name) {
            var indexName = name,
                match = name.match(/^([^\(]*)\s*\(([^\)]*)\)\s*/),
                params = match && match[2];
            name = match && match[1] || name;

            if (!index[indexName]) {
                if (params) {
                    // there can be no function calls here because of the regex match
                    /*jshint evil: true */
                    params = eval('[' + params + ']');
                }
                var mixin = _mixins[name],
                    checkAgain = false,
                    skip = false;

                if (mixin) {
                    if (typeof mixin === 'function') {
                        if (_initiatedOnce[name]) {
                            if (!initiatedOnce[name]) {
                                initiatedOnce[name] = [];
                                // add the placeholder so the mixin ends up in the right place
                                // we will replace all names with the appropriate mixins at the end
                                // (so we have all of the appropriate arguments)
                                mixin = name;
                            } else {
                                // but we only want to add it a single time
                                skip = true;
                            }
                            if (params) {
                                initiatedOnce[name].push(params);
                            }
                        } else {
                            mixin = mixin.apply(this, params || []);
                            checkAgain = true;
                        }
                    } else if (params) {
                        throw new Error('the mixin "' + name + '" does not support parameters');
                    }
                    get(_dependsOn[name], index, initiatedOnce, rtn);
                    get(_dependsInjected[name], index, initiatedOnce, rtn);

                    index[indexName] = true;
                    if (checkAgain) {
                        get([mixin], index, initiatedOnce, rtn);
                    } else if (!skip) {
                        checkForInlineMixins(mixin, rtn);
                        rtn.push(mixin);
                    }

                } else {
                    throw new Error('invalid mixin "' + name + '"');
                }
            }
        }
function addTo ( name ) { var indexName = name , match = name . match ( / ^([^\(]*)\s*\(([^\)]*)\)\s* / ) , params = match && match [ 2 ] ; name = match && match [ 1 ] || name ; if ( ! index [ indexName ] ) { if ( params ) { // there can be no function calls here because of the regex match /*jshint evil: true */ params = eval ( '[' + params + ']' ) ; } var mixin = _mixins [ name ] , checkAgain = false , skip = false ; if ( mixin ) { if ( typeof mixin === 'function' ) { if ( _initiatedOnce [ name ] ) { if ( ! initiatedOnce [ name ] ) { initiatedOnce [ name ] = [ ] ; // add the placeholder so the mixin ends up in the right place // we will replace all names with the appropriate mixins at the end // (so we have all of the appropriate arguments) mixin = name ; } else { // but we only want to add it a single time skip = true ; } if ( params ) { initiatedOnce [ name ] . push ( params ) ; } } else { mixin = mixin . apply ( this , params || [ ] ) ; checkAgain = true ; } } else if ( params ) { throw new Error ( 'the mixin "' + name + '" does not support parameters' ) ; } get ( _dependsOn [ name ] , index , initiatedOnce , rtn ) ; get ( _dependsInjected [ name ] , index , initiatedOnce , rtn ) ; index [ indexName ] = true ; if ( checkAgain ) { get ( [ mixin ] , index , initiatedOnce , rtn ) ; } else if ( ! skip ) { checkForInlineMixins ( mixin , rtn ) ; rtn . push ( mixin ) ; } } else { throw new Error ( 'invalid mixin "' + name + '"' ) ; } } }
add the named mixin and all un-added dependencies to the return array
@param the mixin name
add the named mixin and all un - added dependencies to the return array