Browse Source

Declare variable in local scope instead of in else if statement, due to warning about uninitialized variable l.156, and set it to undefined to keep code compatibility

Tristan VALCKE 8 years ago
parent
commit
2d7a63da57
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/animation/AnimationObjectGroup.js

+ 3 - 2
src/animation/AnimationObjectGroup.js

@@ -92,7 +92,8 @@ AnimationObjectGroup.prototype = {
 
 
 			var object = arguments[ i ],
 			var object = arguments[ i ],
 				uuid = object.uuid,
 				uuid = object.uuid,
-				index = indicesByUUID[ uuid ];
+				index = indicesByUUID[ uuid ],
+				knownObject = undefined;
 
 
 			if ( index === undefined ) {
 			if ( index === undefined ) {
 
 
@@ -114,7 +115,7 @@ AnimationObjectGroup.prototype = {
 
 
 			} else if ( index < nCachedObjects ) {
 			} else if ( index < nCachedObjects ) {
 
 
-				var knownObject = objects[ index ];
+				knownObject = objects[ index ];
 
 
 				// move existing object to the ACTIVE region
 				// move existing object to the ACTIVE region