Explorar o código

Three.js: Fixed __THREE__ code.

Mr.doob %!s(int64=4) %!d(string=hai) anos
pai
achega
2a853ac822
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      src/Three.js

+ 8 - 5
src/Three.js

@@ -165,13 +165,16 @@ if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
 
 }
 
-if ( typeof __THREE__ !== undefined ) {
+if ( window ) {
 
-	console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
+	if ( window.__THREE__ ) {
 
-} else {
+		console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
 
-	// eslint-disable-next-line no-undef
-	__THREE__ = REVISION;
+	} else {
+
+		window.__THREE__ = REVISION;
+
+	}
 
 }