Browse Source

Protect Texture against the closure circular reference bug

Tristan VALCKE 8 years ago
parent
commit
4a887c434c
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/textures/Texture.js

+ 2 - 3
src/textures/Texture.js

@@ -59,7 +59,7 @@ function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, ty
 Texture.DEFAULT_IMAGE = undefined;
 Texture.DEFAULT_MAPPING = UVMapping;
 
-Texture.prototype = {
+Object.assign( Texture.prototype, EventDispatcher.prototype, {
 
 	constructor: Texture,
 
@@ -283,8 +283,7 @@ Texture.prototype = {
 
 	}
 
-};
+} );
 
-Object.assign( Texture.prototype, EventDispatcher.prototype );
 
 export { Texture };