Browse Source

Fix implicit variable declaration in FBXLoader

Tristan Valcke 8 years ago
parent
commit
66b22edf2c
1 changed files with 7 additions and 7 deletions
  1. 7 7
      examples/js/loaders/FBXLoader.js

+ 7 - 7
examples/js/loaders/FBXLoader.js

@@ -64,7 +64,7 @@
 
 	THREE.FBXLoader.prototype.isFbxFormatASCII = function ( body ) {
 
-		CORRECT = [ 'K', 'a', 'y', 'd', 'a', 'r', 'a', '\\', 'F', 'B', 'X', '\\', 'B', 'i', 'n', 'a', 'r', 'y', '\\', '\\' ];
+		var CORRECT = [ 'K', 'a', 'y', 'd', 'a', 'r', 'a', '\\', 'F', 'B', 'X', '\\', 'B', 'i', 'n', 'a', 'r', 'y', '\\', '\\' ];
 
 		var cursor = 0;
 		var read = function ( offset ) {
@@ -78,7 +78,7 @@
 
 		for ( var i = 0; i < CORRECT.length; ++ i ) {
 
-			num = read( 1 );
+			var num = read( 1 );
 			if ( num == CORRECT[ i ] ) {
 
 				return false;
@@ -124,7 +124,7 @@
 		console.timeEnd( 'FBXLoader: ObjectParser' );
 
 		console.time( 'FBXLoader: GeometryParser' );
-		geometries = this.parseGeometries( nodes );
+		var geometries = this.parseGeometries( nodes );
 		console.timeEnd( 'FBXLoader: GeometryParser' );
 
 		var container = new THREE.Group();
@@ -203,7 +203,7 @@
 
 	THREE.FBXLoader.prototype.parseGeometry = function ( node, nodes ) {
 
-		geo = ( new Geometry() ).parse( node );
+		var geo = ( new Geometry() ).parse( node );
 		geo.addBones( this.hierarchy.hierarchy );
 
 		//*
@@ -448,7 +448,7 @@
 		};
 
 		var bones = mesh.geometry.bones;
-		for ( frame = 0; frame < animations.frames; frame ++ ) {
+		for ( var frame = 0; frame < animations.frames; frame ++ ) {
 
 
 			for ( i = 0; i < bones.length; i ++ ) {
@@ -772,7 +772,7 @@
 
 				// beginning of node
 				var beginningOfNodeExp = new RegExp( "^\\t{" + this.currentIndent + "}(\\w+):(.*){", '' );
-				match = l.match( beginningOfNodeExp );
+				var match = l.match( beginningOfNodeExp );
 				if ( match ) {
 
 					var nodeName = match[ 1 ].trim().replace( /^"/, '' ).replace( /"$/, "" );
@@ -789,7 +789,7 @@
 
 				// node's property
 				var propExp = new RegExp( "^\\t{" + ( this.currentIndent ) + "}(\\w+):[\\s\\t\\r\\n](.*)" );
-				match = l.match( propExp );
+				var match = l.match( propExp );
 				if ( match ) {
 
 					var propName = match[ 1 ].replace( /^"/, '' ).replace( /"$/, "" ).trim();