Browse Source

another try to fix node.js problem

mockey 11 years ago
parent
commit
f9d89cdb40
1 changed files with 4 additions and 2 deletions
  1. 4 2
      std/js/Boot.hx

+ 4 - 2
std/js/Boot.hx

@@ -222,8 +222,10 @@ class Boot {
 	
 	
 	// resolve native JS class (with window or global):
 	// resolve native JS class (with window or global):
 	static function __resolveNativeClass(name:String) untyped {
 	static function __resolveNativeClass(name:String) untyped {
-		var g = __js__("typeof window") != "undefined" ? window : global;
-		return g[name];
+		if (__js__("typeof window") != "undefined")
+			return window[name];
+		else
+			return global[name];
 	}
 	}
 
 
 }
 }