Explorar o código

Three.js: Log a warning when importing multiple instances of the library.

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

+ 11 - 0
src/Three.js

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