base-base-debug.js revision 10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The base module provides the Base class, which objects requiring attribute and custom event support can extend.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * plugin support and also provides the Base.build method which provides a way to build custom classes using extensions.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @module base
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host,
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * and without the extension support provided by Base.build.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @module base
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @submodule base-base
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass var O = Y.Object,
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass OBJECT_CONSTRUCTOR = Object.prototype.constructor,
d41a8347476e02c3d2dea77d95cd665717c1082cSatyen Desai for (p in s) {
d41a8347476e02c3d2dea77d95cd665717c1082cSatyen Desai r[p] = s[p];
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * A base class which objects requiring attributes and custom event support can
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * extend. Base also handles the chaining of initializer and destructor methods across
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * the hierarchy as part of object construction and destruction. Additionally, attributes configured
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * through the static <a href="#property_Base.ATTRS">ATTRS</a> property for each class
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * in the hierarchy will be initialized by Base.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The static <a href="#property_Base.NAME">NAME</a> property of each class extending
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * from Base will be used as the identifier for the class, and is used by Base to prefix
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * all events fired by instances of that class.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @class Base
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @constructor
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @uses Attribute
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @uses Plugin.Host
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Object} config Object with configuration property name/value pairs. The object can be
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * used to provide default values for the objects published attributes.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The config object can also contain the following non-attribute properties, providing a convenient
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * way to configure events listeners and plugins for the instance, as part of the constructor call:
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * <dt>on</dt>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * <dd>An event name to listener function map, to register event listeners for the "on" moment of the event. A constructor convenience property for the <a href="Base.html#method_on">on</a> method.</dd>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * <dt>after</dt>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * <dd>An event name to listener function map, to register event listeners for the "after" moment of the event. A constructor convenience property for the <a href="Base.html#method_after">after</a> method.</dd>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * <dt>bubbleTargets</dt>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * <dd>An object, or array of objects, to register as bubble targets for bubbled events fired by this instance. A constructor convenience property for the <a href="EventTarget.html#method_addTarget">addTarget</a> method.</dd>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * <dt>plugins</dt>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * <dd>A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details). A constructor convenience property for the <a href="Plugin.Host.html#method_plug">plug</a> method.</dd>
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass function Base() {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // So the object can be used as a hash key (as DD does)
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // If Plugin.Host has been augmented [ through base-pluginhost ], setup it's
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // initial state, but don't initialize Plugins yet. That's done after initialization.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass if (this._lazyAddAttrs !== false) { this._lazyAddAttrs = true; }
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The string used to identify the class of this object.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @deprecated Use this.constructor.NAME
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @property name
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @type String
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass this._eventPrefix = this.constructor.EVENT_PREFIX || this.constructor.NAME;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The list of properties which can be configured for
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * each attribute (e.g. setter, getter, writeOnce, readOnly etc.)
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith * @property _ATTR_CFG
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @type Array
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Base._ATTR_CFG = Attribute._ATTR_CFG.concat("cloneDefaultValue");
d41a8347476e02c3d2dea77d95cd665717c1082cSatyen Desai Base._ATTR_CFG_HASH = Y.Array.hash(Base._ATTR_CFG);
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The string to be used to identify instances of
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * this class, for example in prefixing events.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Classes extending Base, should define their own
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * static NAME property, which should be camelCase by
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * convention (e.g. MyClass.NAME = "myClass";).
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith * @property NAME
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @type String
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * The default set of attributes which will be available for instances of this class, and
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * their configuration. In addition to the configuration properties listed by
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Attribute's <a href="Attribute.html#method_addAttr">addAttr</a> method, the attribute
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * can also be configured with a "cloneDefaultValue" property, which defines how the statically
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * defined value field should be protected ("shallow", "deep" and false are supported values).
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * By default if the value is an object literal or an array it will be "shallow" cloned, to
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * protect the default value.
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith * @property ATTRS
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @type Object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Flag indicating whether or not this object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * has been through the init lifecycle phase.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @attribute initialized
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @default false
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @type boolean
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Flag indicating whether or not this object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * has been through the destroy lifecycle phase.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @attribute destroyed
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @default false
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @type boolean
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Init lifecycle method, invoked during construction.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Fires the init event prior to setting up attributes and
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * invoking initializers for the class hierarchy.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method init
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @chainable
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Object} config Object with configuration property name/value pairs
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @return {Base} A reference to this object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Lifecycle event for the init phase, fired prior to initialization.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Invoking the preventDefault() method on the event object provided
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * to subscribers will prevent initialization from occuring.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Subscribers to the "after" momemt of this event, will be notified
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * after initialization of the object is complete (and therefore
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * cannot prevent initialization).
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @event init
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @preventable _defInitFn
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {EventFacade} e Event object, with a cfg property which
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * refers to the configuration object passed to the constructor.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass return this;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Handles the special on, after and target properties which allow the user to
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * easily configure on and after listeners as well as bubble targets during
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * construction, prior to init.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _preInitEventCfg
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Object} config The user configuration object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass userTargets = (config && BUBBLETARGETS in config);
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass target = userTargets ? (config && config.bubbleTargets) : this._bubbleTargets;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass } else if (target) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Destroy lifecycle method. Fires the destroy
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * event, prior to invoking destructors for the
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * class hierarchy.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Subscribers to the destroy
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * event can invoke preventDefault on the event object, to prevent destruction
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * from proceeding.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method destroy
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @return {Base} A reference to this object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @chainable
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass destroy: function() {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Lifecycle event for the destroy phase,
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * fired prior to destruction. Invoking the preventDefault
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * method on the event object provided to subscribers will
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * prevent destruction from proceeding.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Subscribers to the "after" moment of this event, will be notified
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * after destruction is complete (and as a result cannot prevent
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * destruction).
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @event destroy
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @preventable _defDestroyFn
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {EventFacade} e Event object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass return this;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Default init event handler
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _defInitFn
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {EventFacade} e Event object, with a cfg property which
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * refers to the configuration object passed to the constructor.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @protected
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass _defInitFn : function(e) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // Need to initPlugins manually, to handle constructor parsing, static Plug parsing
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Default destroy event handler
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _defDestroyFn
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {EventFacade} e Event object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @protected
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass _defDestroyFn : function(e) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Returns the class hierarchy for this object, with Base being the last class in the array.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _getClasses
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @protected
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @return {Function[]} An array of classes (constructor functions), making up the class hierarchy for this object.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * This value is cached the first time the method, or _getAttrCfgs, is invoked. Subsequent invocations return the
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * cached value.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass _getClasses : function() {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Returns an aggregated set of attribute configurations, by traversing the class hierarchy.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _getAttrCfgs
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @protected
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @return {Object} The hash of attribute configurations, aggregated across classes in the hierarchy
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * This value is cached the first time the method, or _getClasses, is invoked. Subsequent invocations return
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * the cached value.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass _getAttrCfgs : function() {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass if (!this._attrs) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass return this._attrs;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * A helper method used when processing ATTRS across the class hierarchy during
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * initialization. Returns a disposable object with the attributes defined for
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * the provided class, extracted from the set of all attributes passed in .
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _filterAttrCfs
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Function} clazz The class for which the desired attributes are required.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Object} allCfgs The set of all attribute configurations for this instance.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Attributes will be removed from this set, if they belong to the filtered class, so
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * that by the time all classes are processed, allCfgs will be empty.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @return {Object} The set of attributes belonging to the class passed in, in the form
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * of an object with attribute name/configuration pairs.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * A helper method used by _getClasses and _getAttrCfgs, which determines both
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * the array of classes and aggregate set of attribute configurations
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * across the class hierarchy for the instance.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _initHierarchyData
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // Add to classes
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // Add to attributes
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass c = c.superclass ? c.superclass.constructor : null;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * A helper method, used by _initHierarchyData to aggregate
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * attribute configuration across the instances class hierarchy.
d41a8347476e02c3d2dea77d95cd665717c1082cSatyen Desai * The method will protect the attribute configuration value to protect the statically defined
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * default value in ATTRS if required (if the value is an object literal, array or the
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * attribute configuration has cloneDefaultValue set to shallow or deep).
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _aggregateAttrs
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Array} allAttrs An array of ATTRS definitions across classes in the hierarchy
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * (subclass first, Base last)
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @return {Object} The aggregate set of ATTRS definitions for the instance
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // Protect config passed in
d41a8347476e02c3d2dea77d95cd665717c1082cSatyen Desai //cfg = Y.mix({}, attrs[attr], true, cfgProps);
d41a8347476e02c3d2dea77d95cd665717c1082cSatyen Desai //cfg = Y.Object(attrs[attr]);
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass if ( (clone === undefined && (OBJECT_CONSTRUCTOR === val.constructor || L.isArray(val))) || clone === DEEP || clone === true) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Y.log('Cloning default value for attribute:' + attr, 'info', 'base');
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass Y.log('Merging default value for attribute:' + attr, 'info', 'base');
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // else if (clone === false), don't clone the static default value.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // It's intended to be used by reference.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass if (path && aggAttrs[attr] && aggAttrs[attr].value) {
d41a8347476e02c3d2dea77d95cd665717c1082cSatyen Desai } else if (!path) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Initializes the class hierarchy for the instance, which includes
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * initializing attributes for each class defined in the class's
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * static <a href="#property_Base.ATTRS">ATTRS</a> property and
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * invoking the initializer method on the prototype of each class in the hierarchy.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _initHierarchy
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Object} userVals Object with configuration property name/value pairs
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass this.addAttrs(this._filterAttrCfgs(constr, attrCfgs), userVals, lazy);
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // Using INITIALIZER in hasOwnProperty check, for performance reasons (helps IE6 avoid GC thresholds when
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // referencing string literals). Not using it in apply, again, for performance "." is faster.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Destroys the class hierarchy for this instance by invoking
d41a8347476e02c3d2dea77d95cd665717c1082cSatyen Desai * the destructor method on the prototype of each class in the hierarchy.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _destroyHierarchy
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass for (ci = 0, cl = classes.length; ci < cl; ci++) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Default toString implementation. Provides the constructor NAME
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * and the instance guid, if set.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method toString
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @return {String} String representation for this object
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass toString: function() {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass return this.name + "[" + Y.stamp(this, true) + "]";
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // Straightup augment, no wrapper functions
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass // Fix constructor