Browse Source

Three.js: Fixed __THREE__ code.

Mr.doob 4 years ago
parent
commit
2a853ac822
1 changed files with 8 additions and 5 deletions
  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;
+
+	}
 
 }