build/updates/builder.js
function (info, classItems, first) {
            var self = this;
            self._mergeCounter = (first) ? 0 : (self._mergeCounter + 1);

            if (self._mergeCounter === 100) {
                throw ('YUIDoc detected a loop extending class ' + info.name);
            }
            if (info.extends || info.uses) {
                var hasItems = {};
                hasItems[info.extends] = 1;
                if (info.uses) {
                    info.uses.forEach(function (v) {
                        hasItems[v] = 1;
                    });
                }
                self.data.classitems.forEach(function (v) {
                    //console.error(v.class, '==', info.extends);
                    if (hasItems[v.class]) {
                        if (!v.static) {
                            var q,
                                override = self.hasProperty(classItems, v);
                            if (override === false) {
                                //This method was extended from the parent class but not over written
                                //console.error('Merging extends from', v.class, 'onto', info.name);
                                q = Y.merge({}, v);
                                q.extended_from = v.class;
                                classItems.push(q);
                            } else {
                                //This method was extended from the parent and overwritten in this class
                                q = Y.merge({}, v);
                                q = self.augmentData(q);
                                classItems[override].overwritten_from = q;
                            }
                        }
                    }
                });
                if (self.data.classes[info.extends]) {
                    if (self.data.classes[info.extends].extends || self.data.classes[info.extends].uses) {
                        //console.error('Stepping down to:', self.data.classes[info.extends]);
                        classItems = self.mergeExtends(self.data.classes[info.extends], classItems);
                    }
                }
            }
            return classItems;
        }
function (info, classItems, first) {
            var self = this;
            self._mergeCounter = (first) ? 0 : (self._mergeCounter + 1);

            if (self._mergeCounter === 100) {
                throw ('YUIDoc detected a loop extending class ' + info.name);
            }
            if (info.extends || info.uses) {
                var hasItems = {};
                hasItems[info.extends] = 1;
                if (info.uses) {
                    info.uses.forEach(function (v) {
                        hasItems[v] = 1;
                    });
                }
                self.data.classitems.forEach(function (v) {
                    //console.error(v.class, '==', info.extends);
                    if (hasItems[v.class]) {
                        if (!v.static) {
                            var q,
                                override = self.hasProperty(classItems, v);
                            if (override === false) {
                                //This method was extended from the parent class but not over written
                                //console.error('Merging extends from', v.class, 'onto', info.name);
                                q = Y.merge({}, v);
                                q.extended_from = v.class;
                                classItems.push(q);
                            } else {
                                //This method was extended from the parent and overwritten in this class
                                q = Y.merge({}, v);
                                q = self.augmentData(q);
                                classItems[override].overwritten_from = q;
                            }
                        }
                    }
                });
                if (self.data.classes[info.extends]) {
                    if (self.data.classes[info.extends].extends || self.data.classes[info.extends].uses) {
                        //console.error('Stepping down to:', self.data.classes[info.extends]);
                        classItems = self.mergeExtends(self.data.classes[info.extends], classItems);
                    }
                }
            }
            return classItems;
        }
function ( info , classItems , first ) { var self = this ; self . _mergeCounter = ( first ) ? 0 : ( self . _mergeCounter + 1 ) ; if ( self . _mergeCounter === 100 ) { throw ( 'YUIDoc detected a loop extending class ' + info . name ) ; } if ( info . extends || info . uses ) { var hasItems = { } ; hasItems [ info . extends ] = 1 ; if ( info . uses ) { info . uses . forEach ( function ( v ) { hasItems [ v ] = 1 ; } ) ; } self . data . classitems . forEach ( function ( v ) { //console.error(v.class, '==', info.extends); if ( hasItems [ v . class ] ) { if ( ! v . static ) { var q , override = self . hasProperty ( classItems , v ) ; if ( override === false ) { //This method was extended from the parent class but not over written //console.error('Merging extends from', v.class, 'onto', info.name); q = Y . merge ( { } , v ) ; q . extended_from = v . class ; classItems . push ( q ) ; } else { //This method was extended from the parent and overwritten in this class q = Y . merge ( { } , v ) ; q = self . augmentData ( q ) ; classItems [ override ] . overwritten_from = q ; } } } } ) ; if ( self . data . classes [ info . extends ] ) { if ( self . data . classes [ info . extends ] . extends || self . data . classes [ info . extends ] . uses ) { //console.error('Stepping down to:', self.data.classes[info.extends]); classItems = self . mergeExtends ( self . data . classes [ info . extends ] , classItems ) ; } } } return classItems ; }
Merge superclass data into a child class
@method mergeExtends
@param {Object} info The item to extend
@param {Array} classItems The list of items to merge in
@param {Boolean} first Set for the first call
Merge superclass data into a child class