Procházet zdrojové kódy

Protect Texture against the closure circular reference bug

Tristan VALCKE před 8 roky
rodič
revize
4a887c434c
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  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 };