Просмотр исходного кода

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 9 лет назад
Родитель
Сommit
2d7a63da57
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/animation/AnimationObjectGroup.js

+ 3 - 2
src/animation/AnimationObjectGroup.js

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

粤ICP备19079148号