1
0
Fork 0

Added setup_props function to prepare for adding multiple properties to generated classes

closure/master
Mike Gerwitz 2010-11-14 00:49:52 -05:00
parent a083313538
commit 9dc025e6b1
1 changed files with 17 additions and 4 deletions

View File

@ -182,7 +182,7 @@ function extend()
prototype.parent = base.prototype; prototype.parent = base.prototype;
// set up the new class // set up the new class
attach_extend( new_class ); setup_props( new_class );
new_class.prototype = prototype; new_class.prototype = prototype;
new_class.constructor = new_class; new_class.constructor = new_class;
@ -191,11 +191,24 @@ function extend()
/** /**
* Attaches extend method to the given function's prototype * Sets up common properties for the provided function (class)
* *
* @param {Function} func function to attach method to * @param {Function} func function (class) to attach properties to
* *
* @return undefined * @return {undefined}
*/
function setup_props( func )
{
attach_extend( func );
}
/**
* Attaches extend method to the given function (class)
*
* @param {Function} func function (class) to attach method to
*
* @return {undefined}
*/ */
function attach_extend( func ) function attach_extend( func )
{ {