Jelajahi Sumber

name all anonymous functions for better results when profiling.

Ben Houston 10 tahun lalu
induk
melakukan
3d2b5ebcd5

+ 9 - 9
src/animation/AnimationUtils.js

@@ -8,12 +8,12 @@
  	getEqualsFunc: function( exemplarValue ) {
  	getEqualsFunc: function( exemplarValue ) {
 
 
 		if( exemplarValue.equals ) {
 		if( exemplarValue.equals ) {
-			return function( a, b ) {
+			return function equals_object( a, b ) {
 				return a.equals( b );
 				return a.equals( b );
 			}
 			}
 		}
 		}
 
 
-		return function( a, b ) {
+		return function equals_primitive( a, b ) {
 			return ( a === b );	
 			return ( a === b );	
 		};
 		};
 
 
@@ -52,14 +52,14 @@
 
 
 				if( exemplarValue.lerp ) {
 				if( exemplarValue.lerp ) {
 
 
-					return function( a, b, alpha ) {
+					return function lerp_object( a, b, alpha ) {
 						return a.lerp( b, alpha );
 						return a.lerp( b, alpha );
 					}
 					}
 
 
 				}
 				}
 				if( exemplarValue.slerp ) {
 				if( exemplarValue.slerp ) {
 
 
-					return function( a, b, alpha ) {
+					return function slerp_object( a, b, alpha ) {
 						return a.slerp( b, alpha );
 						return a.slerp( b, alpha );
 					}
 					}
 
 
@@ -67,30 +67,30 @@
 				break;
 				break;
 			}
 			}
 		 	case "number": {
 		 	case "number": {
-				return function( a, b, alpha ) {
+				return function lerp_number( a, b, alpha ) {
 					return a * ( 1 - alpha ) + b * alpha;
 					return a * ( 1 - alpha ) + b * alpha;
 				}
 				}
 		 	}	
 		 	}	
 		 	case "boolean": {
 		 	case "boolean": {
 		 		if( interTrack ) {
 		 		if( interTrack ) {
-					return function( a, b, alpha ) {
+					return function lerp_boolean( a, b, alpha ) {
 			 			return ( alpha < 0.5 ) ? a : b;
 			 			return ( alpha < 0.5 ) ? a : b;
 			 		}
 			 		}
 		 		}
 		 		}
 		 		else {
 		 		else {
-					return function( a, b, alpha ) {
+					return function lerp_boolean_immediate( a, b, alpha ) {
 			 			return a;
 			 			return a;
 			 		}
 			 		}
 		 		}
 		 		}
 		 	}
 		 	}
 		 	case "string": {
 		 	case "string": {
 		 		if( interTrack ) {
 		 		if( interTrack ) {
-					return function( a, b, alpha ) {
+					return function lerp_string( a, b, alpha ) {
 			 			return ( alpha < 0.5 ) ? a : b;
 			 			return ( alpha < 0.5 ) ? a : b;
 			 		}
 			 		}
 		 		}
 		 		}
 		 		else {
 		 		else {
-					return function( a, b, alpha ) {
+					return function lerp_string_immediate( a, b, alpha ) {
 				 		return a;		 		
 				 		return a;		 		
 				 	}
 				 	}
 			 	}
 			 	}

+ 1 - 1
src/animation/KeyframeTrack.js

@@ -107,7 +107,7 @@ THREE.KeyframeTrack.prototype = {
 	// sort in ascending order
 	// sort in ascending order
 	sort: function() {
 	sort: function() {
 
 
-		var keyComparator = function(key0, key1) {
+		var keyComparator = function keyComparator(key0, key1) {
 			return key0.time - key1.time;
 			return key0.time - key1.time;
 		};
 		};
 
 

+ 8 - 8
src/animation/PropertyBinding.js

@@ -172,7 +172,7 @@ THREE.PropertyBinding.prototype = {
 				}
 				}
 			}
 			}
 
 
-			this.setValue = function( value ) {
+			this.setValue = function setValue_propertyIndexed( value ) {
 				if( ! this.equalsValue( nodeProperty[ this.propertyIndex ], value ) ) {
 				if( ! this.equalsValue( nodeProperty[ this.propertyIndex ], value ) ) {
 					nodeProperty[ this.propertyIndex ] = value;
 					nodeProperty[ this.propertyIndex ] = value;
 					return true;
 					return true;
@@ -180,7 +180,7 @@ THREE.PropertyBinding.prototype = {
 				return false;
 				return false;
 			};
 			};
 
 
-			this.getValue = function() {
+			this.getValue = function getValue_propertyIndexed() {
 				return nodeProperty[ this.propertyIndex ];
 				return nodeProperty[ this.propertyIndex ];
 			};
 			};
 
 
@@ -188,7 +188,7 @@ THREE.PropertyBinding.prototype = {
 		// must use copy for Object3D.Euler/Quaternion		
 		// must use copy for Object3D.Euler/Quaternion		
 		else if( nodeProperty.copy ) {
 		else if( nodeProperty.copy ) {
 			
 			
-			this.setValue = function( value ) {
+			this.setValue = function setValue_propertyObject( value ) {
 				if( ! this.equalsValue( nodeProperty, value ) ) {
 				if( ! this.equalsValue( nodeProperty, value ) ) {
 					nodeProperty.copy( value );
 					nodeProperty.copy( value );
 					return true;
 					return true;
@@ -196,7 +196,7 @@ THREE.PropertyBinding.prototype = {
 				return false;
 				return false;
 			}
 			}
 
 
-			this.getValue = function() {
+			this.getValue = function getValue_propertyObject() {
 				return nodeProperty;
 				return nodeProperty;
 			};
 			};
 
 
@@ -204,7 +204,7 @@ THREE.PropertyBinding.prototype = {
 		// otherwise just set the property directly on the node (do not use nodeProperty as it may not be a reference object)
 		// otherwise just set the property directly on the node (do not use nodeProperty as it may not be a reference object)
 		else {
 		else {
 
 
-			this.setValue = function( value ) {
+			this.setValue = function setValue_property( value ) {
 				if( ! this.equalsValue( targetObject[ this.propertyName ], value ) ) {
 				if( ! this.equalsValue( targetObject[ this.propertyName ], value ) ) {
 					targetObject[ this.propertyName ] = value;	
 					targetObject[ this.propertyName ] = value;	
 					return true;
 					return true;
@@ -212,7 +212,7 @@ THREE.PropertyBinding.prototype = {
 				return false;
 				return false;
 			}
 			}
 
 
-			this.getValue = function() {
+			this.getValue = function getValue_property() {
 				return targetObject[ this.propertyName ];
 				return targetObject[ this.propertyName ];
 			};
 			};
 
 
@@ -221,14 +221,14 @@ THREE.PropertyBinding.prototype = {
 		// trigger node dirty			
 		// trigger node dirty			
 		if( targetObject.needsUpdate !== undefined ) { // material
 		if( targetObject.needsUpdate !== undefined ) { // material
 			
 			
-			this.triggerDirty = function() {
+			this.triggerDirty = function triggerDirty_needsUpdate() {
 				this.node.needsUpdate = true;
 				this.node.needsUpdate = true;
 			}
 			}
 
 
 		}			
 		}			
 		else if( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform
 		else if( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform
 			
 			
-			this.triggerDirty = function() {
+			this.triggerDirty = function triggerDirty_matrixWorldNeedsUpdate() {
 				targetObject.matrixWorldNeedsUpdate = true;
 				targetObject.matrixWorldNeedsUpdate = true;
 			}
 			}