Browse Source

'window' to 'self' in npm header.

Ben Houston 12 years ago
parent
commit
d0f65966c2
1 changed files with 5 additions and 7 deletions
  1. 5 7
      utils/npm/header.js

+ 5 - 7
utils/npm/header.js

@@ -1,20 +1,18 @@
-
-var window = window || {};
 var self = self || {};
 
 // High-resulution counter: emulate window.performance.now() for THREE.CLOCK
-if( window.performance === undefined ) {
+if( self.performance === undefined ) {
 
-	window.performance = { };
+	self.performance = {};
 
 }
 
-if( window.performance.now === undefined ) {
+if( self.performance.now === undefined ) {
 
 	// check if we are in a Node.js environment
 	if( ( process !== undefined ) && ( process.hrtime !== undefined ) ) {
 
-		window.performance.now = function () {
+		self.performance.now = function () {
 
 			var time = process.hrtime();
 			return ( time[0] + time[1] / 1e9 ) * 1000;
@@ -25,7 +23,7 @@ if( window.performance.now === undefined ) {
 	// if not Node.js revert to using the Date class
 	else {
 
-		window.performance.now = function() {
+		self.performance.now = function() {
 
 			return new Date().getTime();