 {
 	public class JS
 	{
+		private static function getGlobal(name:String):*
+		{
+			var Fn:Class = Function;
+			var fn:Function = new Fn("return " + name + ";");
+			return fn();
+		}
+		
 		/**
 		 * AS->JS Language helper to get the global scope
 		 */
-		public static const global:Object = (function():* { return this; }).apply(null);
+		public static const global:Object = getGlobal("window");
+		
+		private static const console:Object = getGlobal("console");
+		private static const Symbol:Object = getGlobal("Symbol");
 		
 		/**
 		 * Calls console.error()
 		 */
 		public static function error(...args):void
 		{
-			global.console.error.apply(global.console, args);
+			console.error.apply(console, args);
 		}
 		
 		/**

		public static function compile(script:String, paramNames:Array = null):Function
		{
			var paramsStr:String = paramNames ? paramNames.join(',') : '';
			return global.eval("(function(" + paramsStr + "){ return eval(" + JSON.stringify(script) + "); })");
		}
		
		/**
		 * AS->JS Language helper for Promise
		 */
		public static const Promise:Class = (function():* { return this['Promise']; }).apply(null);
		
		/**
		 * AS->JS Language helper for Map
		 */
		public static const Map:Class = (function():* { return this['Map']; }).apply(null);
		
		/**
		 * AS->JS Language helper for WeakMap
		 */
		public static const WeakMap:Class = (function():* { return this['WeakMap']; }).apply(null);
		
		/**
		 * AS->JS Language helper for getting an Array of Map keys.

		 */
		public static function log(...args):void
		{
			console.log.apply(console, args);
		}
		
		/**
