From 789f2390af6dd65faee9ac8910f976f24abe97f0 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 28 Dec 2010 22:08:30 -0500 Subject: [PATCH] All functions are now camelCase --- lib/class.js | 22 +++++++++++----------- lib/interface.js | 4 ++-- lib/util.js | 46 +++++++++++++++++++++++----------------------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/class.js b/lib/class.js index d79c86b..49055a8 100644 --- a/lib/class.js +++ b/lib/class.js @@ -168,10 +168,10 @@ var extend = ( function( extending ) prototype.parent = base.prototype; // set up the new class - var new_class = create_ctor( abstract_methods ); + var new_class = createCtor( abstract_methods ); - setup_props( new_class, abstract_methods ); - attach_prop_init( prototype, properties ); + setupProps( new_class, abstract_methods ); + attachPropInit( prototype, properties ); new_class.prototype = prototype; new_class.constructor = new_class; @@ -197,7 +197,7 @@ var extend = ( function( extending ) * * @return {Function} constructor */ - function create_ctor( abstract_methods ) + function createCtor( abstract_methods ) { // concrete class if ( abstract_methods.length === 0 ) @@ -229,7 +229,7 @@ var extend = ( function( extending ) // abstract class else { - return function () + return function() { if ( !extending ) { @@ -249,10 +249,10 @@ var extend = ( function( extending ) * * @return {undefined} */ -function setup_props( func, abstract_methods ) +function setupProps( func, abstract_methods ) { - attach_abstract( func, abstract_methods ); - attach_extend( func ); + attachAbstract( func, abstract_methods ); + attachExtend( func ); } @@ -272,7 +272,7 @@ function setup_props( func, abstract_methods ) * * @return {undefined} */ -function attach_prop_init( prototype, properties ) +function attachPropInit( prototype, properties ) { util.defineSecureProp( prototype, '__initProps', function() { @@ -304,7 +304,7 @@ function attach_prop_init( prototype, properties ) * * @return {undefined} */ -function attach_abstract( func, methods ) +function attachAbstract( func, methods ) { var is_abstract = ( methods.length > 0 ) ? true: false; @@ -333,7 +333,7 @@ function attach_abstract( func, methods ) * * @return {undefined} */ -function attach_extend( func ) +function attachExtend( func ) { /** * Shorthand for extending classes diff --git a/lib/interface.js b/lib/interface.js index b54bb1c..8f8a1c1 100644 --- a/lib/interface.js +++ b/lib/interface.js @@ -70,7 +70,7 @@ function extend() }, } ); - attach_extend( new_interface ); + attachExtend( new_interface ); new_interface.prototype = prototype; new_interface.constructor = new_interface; @@ -121,7 +121,7 @@ function inheritCheck( prototype ) * * @return {undefined} */ -function attach_extend( func ) +function attachExtend( func ) { /** * Shorthand for extending interfaces diff --git a/lib/util.js b/lib/util.js index f0a6397..f93c229 100644 --- a/lib/util.js +++ b/lib/util.js @@ -151,12 +151,12 @@ exports.clone = function( data ) exports.propParse = function( data, options ) { var fvoid = function() {}, - callback_each = options.each || undefined, - callback_prop = options.property || fvoid, - callback_method = options.method || fvoid, - callback_getter = options.getter || fvoid, - callback_setter = options.setter || fvoid, - keyword_parser = options.keywordParser || propParseKeywords, + callbackEach = options.each || undefined, + callbackProp = options.property || fvoid, + callbackMethod = options.method || fvoid, + callbackGetter = options.getter || fvoid, + callbackSetter = options.setter || fvoid, + keywordParser = options.keywordParser || propParseKeywords, hasOwn = Object.prototype.hasOwnProperty, @@ -181,7 +181,7 @@ exports.propParse = function( data, options ) getter = ( ( getset ) ? data.__lookupGetter__( prop ) : null ); setter = ( ( getset ) ? data.__lookupSetter__( prop ) : null ); - parse_data = keyword_parser( prop ) || {}; + parse_data = keywordParser( prop ) || {}; name = parse_data.name || prop; keywords = parse_data.keywords || {}; @@ -198,22 +198,22 @@ exports.propParse = function( data, options ) } // if an 'each' callback was provided, pass the data before parsing it - if ( callback_each ) + if ( callbackEach ) { - callback_each.call( callback_each, name, value ); + callbackEach.call( callbackEach, name, value ); } // getter/setter if ( getter || setter ) { - callback_getter.call( callback_getter, name, getter ); - callback_setter.call( callback_setter, name, setter ); + callbackGetter.call( callbackGetter, name, getter ); + callbackSetter.call( callbackSetter, name, setter ); } // method else if ( value instanceof Function ) { - callback_method.call( - callback_method, + callbackMethod.call( + callbackMethod, name, value, exports.isAbstractMethod( value ) @@ -222,7 +222,7 @@ exports.propParse = function( data, options ) // simple property else { - callback_prop.call( callback_prop, name, value ); + callbackProp.call( callbackProp, name, value ); } } } @@ -249,7 +249,7 @@ exports.propCopy = function( props, dest, actions ) { actions = actions || {}; - var use_or = function( use, or ) + var useOr = function( use, or ) { if ( use instanceof Function ) { @@ -264,7 +264,7 @@ exports.propCopy = function( props, dest, actions ) // substitute default functionality if needed var parse_actions = { - each: use_or( actions.each, function( name, value ) + each: useOr( actions.each, function( name, value ) { // methods can only be overridden with methods if ( ( dest[ name ] instanceof Function ) @@ -275,22 +275,22 @@ exports.propCopy = function( props, dest, actions ) } } ), - property: use_or( actions.property, function( name, value ) + property: useOr( actions.property, function( name, value ) { dest[ name ] = value; } ), - getter: use_or( actions.getter, function( name, func ) + getter: useOr( actions.getter, function( name, func ) { dest.__defineGetter__( name, func ); } ), - setter: use_or( actions.setter, function( name, func ) + setter: useOr( actions.setter, function( name, func ) { dest.__defineSetter__( name, func ); } ), - method: use_or( actions.method, function( name, func, is_abstract ) + method: useOr( actions.method, function( name, func, is_abstract ) { var pre = dest[ name ]; @@ -301,7 +301,7 @@ exports.propCopy = function( props, dest, actions ) { // use provided method override action, or fall back to // generic override - var override_func = use_or( actions.methodOverride, + var overrideFunc = useOr( actions.methodOverride, function( name, pre, func ) { return exports.overrideMethod( name, pre, func ); @@ -310,8 +310,8 @@ exports.propCopy = function( props, dest, actions ) // use call(), passing self in as context, to ensure 'this' // will reference the function itself - dest[ name ] = override_func.call( - override_func, name, pre, func + dest[ name ] = overrideFunc.call( + overrideFunc, name, pre, func ); } else