source/Class.js
function defineAndInheritProperties(Component, properties) {
		var constructor,
			descriptor,
			property,
			propertyDescriptors,
			propertyDescriptorHash,
			propertyDescriptorQueue;

		// Set properties
		Component.properties = properties;

		// Traverse the chain of constructors and gather all property descriptors
		// Build a queue of property descriptors for combination
		propertyDescriptorHash = {};
		constructor = Component;
		do {
			if (constructor.properties) {
				for (property in constructor.properties) {
					propertyDescriptorQueue = propertyDescriptorHash[property] || (propertyDescriptorHash[property] = []);
					propertyDescriptorQueue.unshift(constructor.properties[property]);
				}
			}
			constructor = constructor.superConstructor;
		}
		while (constructor);

		// Combine property descriptors, allowing overriding of individual properties
		propertyDescriptors = {};
		for (property in propertyDescriptorHash) {
			descriptor = propertyDescriptors[property] = extendThis.apply({}, propertyDescriptorHash[property]);

			// Allow setters to be strings
			// An additional wrapping function is used to allow monkey-patching
			// apply is used to handle cases where the setter is called directly
			if (typeof descriptor.set === 'string') {
				descriptor.set = makeApplier(descriptor.set);
			}
			if (typeof descriptor.get === 'string') {
				descriptor.get = makeApplier(descriptor.get);
			}
		}

		// Store option descriptors on the constructor
		Component.properties = propertyDescriptors;
	}
function defineAndInheritProperties(Component, properties) {
		var constructor,
			descriptor,
			property,
			propertyDescriptors,
			propertyDescriptorHash,
			propertyDescriptorQueue;

		// Set properties
		Component.properties = properties;

		// Traverse the chain of constructors and gather all property descriptors
		// Build a queue of property descriptors for combination
		propertyDescriptorHash = {};
		constructor = Component;
		do {
			if (constructor.properties) {
				for (property in constructor.properties) {
					propertyDescriptorQueue = propertyDescriptorHash[property] || (propertyDescriptorHash[property] = []);
					propertyDescriptorQueue.unshift(constructor.properties[property]);
				}
			}
			constructor = constructor.superConstructor;
		}
		while (constructor);

		// Combine property descriptors, allowing overriding of individual properties
		propertyDescriptors = {};
		for (property in propertyDescriptorHash) {
			descriptor = propertyDescriptors[property] = extendThis.apply({}, propertyDescriptorHash[property]);

			// Allow setters to be strings
			// An additional wrapping function is used to allow monkey-patching
			// apply is used to handle cases where the setter is called directly
			if (typeof descriptor.set === 'string') {
				descriptor.set = makeApplier(descriptor.set);
			}
			if (typeof descriptor.get === 'string') {
				descriptor.get = makeApplier(descriptor.get);
			}
		}

		// Store option descriptors on the constructor
		Component.properties = propertyDescriptors;
	}
function defineAndInheritProperties ( Component , properties ) { var constructor , descriptor , property , propertyDescriptors , propertyDescriptorHash , propertyDescriptorQueue ; // Set properties Component . properties = properties ; // Traverse the chain of constructors and gather all property descriptors // Build a queue of property descriptors for combination propertyDescriptorHash = { } ; constructor = Component ; do { if ( constructor . properties ) { for ( property in constructor . properties ) { propertyDescriptorQueue = propertyDescriptorHash [ property ] || ( propertyDescriptorHash [ property ] = [ ] ) ; propertyDescriptorQueue . unshift ( constructor . properties [ property ] ) ; } } constructor = constructor . superConstructor ; } while ( constructor ) ; // Combine property descriptors, allowing overriding of individual properties propertyDescriptors = { } ; for ( property in propertyDescriptorHash ) { descriptor = propertyDescriptors [ property ] = extendThis . apply ( { } , propertyDescriptorHash [ property ] ) ; // Allow setters to be strings // An additional wrapping function is used to allow monkey-patching // apply is used to handle cases where the setter is called directly if ( typeof descriptor . set === 'string' ) { descriptor . set = makeApplier ( descriptor . set ) ; } if ( typeof descriptor . get === 'string' ) { descriptor . get = makeApplier ( descriptor . get ) ; } } // Store option descriptors on the constructor Component . properties = propertyDescriptors ; }
Merge and define properties
Merge and define properties