base-build.js revision 793e508bd277c48d6a09b91bb99064b4046eda7a
/**
* The base-build submodule provides Base.build functionality, which
* can be used to create custom classes, by aggregating extensions onto
* a main class.
*
* @module base
* @submodule base-build
* @for Base
*/
L = Y.Lang;
/**
* The build configuration for the Base class.
*
* Defines the static fields which need to be aggregated
* when the Base class is used as the main class passed to
* the <a href="#method_Base.build">Base.build</a> method.
*
* @property Base._buildCfg
* @type Object
* @static
* @final
* @private
*/
};
/**
* <p>
* Builds a custom constructor function (class) from the
* main function, and array of extension functions (classes)
* provided. The NAME field for the constructor function is
* defined by the first argument passed in.
* </p>
* <p>
* The cfg object literal supports the following properties
* </p>
* <dl>
* <dt>dynamic <boolean></dt>
* <dd>
* <p>If true (default), a completely new class
* is created which extends the main class, and acts as the
* host on which the extension classes are augmented.</p>
* <p>If false, the extensions classes are augmented directly to
* the main class, modifying the main class' prototype.</p>
* </dd>
* <dt>aggregates <String[]></dt>
* <dd>An array of static property names, which will get aggregated
* on to the built class, in addition to the default properties build
* will always aggregate as defined by the main class' static _buildCfg
* property.
* </dd>
* </dl>
*
* @method Base.build
* @static
* @param {Function} main The name of the new class. Used to defined the NAME property for the new class.
* @param {Function} main The main class on which to base the built class
* @param {Function[]} extensions The set of extension classes which will be
* augmented/aggregated to the built class.
* @param {Object} cfg Optional. Build configuration for the class (see description).
* @return {Function} A custom class, created from the provided main and extension classes
*/
// Shallow isolate aggregates
if (dynamic) {
if (aggregates) {
val = aggregates[i];
}
}
}
}
extClass = extensions[i];
if (aggregates) {
}
// Old augment
}
if (dynamic) {
}
return builtClass;
};
function BuiltClass() {
l = f.length,
i;
for (i = 0; i < l; i++) {
}
return this;
}
return BuiltClass;
},
if (this.constructor._yuibuild) {
l = f.length,
i;
for (i = 0; i < l; i++) {
if (f[i] === extClass) {
return true;
}
}
}
return false;
},
builtClass._yuibuild = {
id: null,
exts : [],
};
return builtClass;
},
var aggr = [],
c = main,
while (c && c.prototype) {
if (classAggr) {
}
}
if (cfgAggr) {
}
return aggr;
}
});