2
0
Эх сурвалжийг харах

EventDispatcher: Clean up.

Mr.doob 9 жил өмнө
parent
commit
4fc4098e96

+ 3 - 6
src/core/EventDispatcher.js

@@ -6,9 +6,6 @@ THREE.EventDispatcher = function () {};
 
 
 Object.assign( THREE.EventDispatcher.prototype, {
 Object.assign( THREE.EventDispatcher.prototype, {
 
 
-	// Note: *No* constructor here, this would clobber that property
-	// of the target class when used as a mixin.
-
 	addEventListener: function ( type, listener ) {
 	addEventListener: function ( type, listener ) {
 
 
 		if ( this._listeners === undefined ) this._listeners = {};
 		if ( this._listeners === undefined ) this._listeners = {};
@@ -77,16 +74,16 @@ Object.assign( THREE.EventDispatcher.prototype, {
 
 
 			event.target = this;
 			event.target = this;
 
 
-			var array = [];
+			var array = [], i = 0;
 			var length = listenerArray.length;
 			var length = listenerArray.length;
 
 
-			for ( var i = 0; i < length; i ++ ) {
+			for ( i = 0; i < length; i ++ ) {
 
 
 				array[ i ] = listenerArray[ i ];
 				array[ i ] = listenerArray[ i ];
 
 
 			}
 			}
 
 
-			for ( var i = 0; i < length; i ++ ) {
+			for ( i = 0; i < length; i ++ ) {
 
 
 				array[ i ].call( this, event );
 				array[ i ].call( this, event );