Browse Source

Merge pull request #7747 from simonThiele/dev

Add missing self variable if not defined and when running under node environment
Mr.doob 9 years ago
parent
commit
d295f43ceb
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/Three.js

+ 8 - 0
src/Three.js

@@ -14,6 +14,14 @@ if ( typeof define === 'function' && define.amd ) {
 
 	module.exports = THREE;
 
+	// detects wheather self is not defined and uses global in node environment
+	if ( typeof self === 'undefined' ) {
+
+		// self gets hoisted!
+		var self = global;
+
+	}
+
 }