From 35035d69434cc29beb8e78e29632d8580ece3a63 Mon Sep 17 00:00:00 2001 From: Alexander Gugel Date: Fri, 5 Jun 2015 23:40:19 +0200 Subject: [PATCH] clean: Remove broken window check The TextureManager is only being used by the WebGLRenderer, which always runs in the UI thread. Therefore there is no need to check for the environment it runs in. Besides that, the check would throw an error anyways when being evaluated in a worker, since window wouldn't be defined. This check never worked. If we really want to check if we're in a worker, we need to check if "typeof window !== 'undefined". --- webgl-renderers/TextureManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webgl-renderers/TextureManager.js b/webgl-renderers/TextureManager.js index e85949d0..7c235586 100644 --- a/webgl-renderers/TextureManager.js +++ b/webgl-renderers/TextureManager.js @@ -121,7 +121,7 @@ TextureManager.prototype.register = function register(input, slot) { // Handle video - else if (window && source instanceof window.HTMLVideoElement) { + else if (source instanceof HTMLVideoElement) { source.addEventListener('loadeddata', function() { _this.bindTexture(textureId); texture.setImage(source);