base-build.js revision 3e6c4bcb73ba0f45469c0812f4a9641b64142af8
/**
* The base-build sub-module provides the Base.build functionality
*
* @module base
* @sub-module base-build
*/
L = Y.Lang;
/**
* The build configuration for the Base class.
* Defines the static fields which need to be aggregated,
* when this class is used as the main class passed to
* the <a href="#method_build">Base.build</a> method.
*
* @property _buildCfg
* @type Object
* @static
* @final
* @private
*/
};
/**
* <p>
* Builds a constructor function (class) from the
* main function, and array of extension functions (classes)
* provided.
* </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 classes 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' _buildCfg
* property.
* </dd>
* </dl>
*
* @method build
* @static
* @param {Function} main The name of 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. Configuration for the class.
* @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;
}
});