base-core-debug.js revision f10b3c93791aa567aa9c97435d49a373447f7279
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * The base module provides the Base class, which objects requiring attribute and custom event support can extend.
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions.
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * @module base
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * <p>The base-core module provides the BaseCore class, the lightest version of Base,
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * which provides Base's basic lifecycle management and ATTRS construction support,
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * but doesn't fire init/destroy or attribute change events.</p>
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * <p>It mixes in AttributeCore, which is the lightest version of Attribute</p>
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * @module base
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney * @submodule base-core
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney var O = Y.Object,
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney OBJECT_CONSTRUCTOR = Object.prototype.constructor,
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney for (p in s) {
1f08a8488664773a7d96fa3a043a639692d2a5cbMatt Sweeney r[p] = s[p];
if (!this._BaseInvoked) {
this._BaseInvoked = true;
else { Y.log('Based constructor called more than once. Ignoring duplicate calls', 'life', 'base'); }
* AttributeCore's <a href="AttributeCore.html#method_addAttr">addAttr</a> method,
initialized: {
readOnly:true,
value:false
destroyed: {
readOnly:true,
value:false
Y.stamp(this);
_initAttribute: function() {
if (this._initPlugins) {
destroy: function() {
this._baseDestroy();
_baseDestroy : function() {
if (this._destroyPlugins) {
this._destroyPlugins();
this._destroyHierarchy();
* @return {Function[]} An array of classes (constructor functions), making up the class hierarchy for this object.
* This value is cached the first time the method, or _getAttrCfgs, is invoked. Subsequent invocations return the
_getClasses : function() {
if (!this._classes) {
this._initHierarchyData();
return this._classes;
* This value is cached the first time the method, or _getClasses, is invoked. Subsequent invocations return
_getAttrCfgs : function() {
if (!this._attrs) {
this._initHierarchyData();
return this._attrs;
* of an object with attribute name/configuration pairs.
if (attrs) {
return cfgs;
_initHierarchyData : function() {
var c = this.constructor,
classes = [],
attrs = [];
if (c.ATTRS) {
_attrCfgHash: function() {
var attr,
cfg,
val,
path,
aggAttrs = {};
if (allAttrs) {
if (val) {
if ( (clone === undefined && (OBJECT_CONSTRUCTOR === val.constructor || L.isArray(val))) || clone === DEEP || clone === true) {
path = null;
} else if (!path) {
return aggAttrs;
ci,
ei,
el,
exts,
if (exts) {
// Using INITIALIZER in hasOwnProperty check, for performance reasons (helps IE6 avoid GC thresholds when
if (exts) {
_destroyHierarchy : function() {
var constr,
if (exts) {
toString: function() {